2022-01-19 21:52:59 +00:00
|
|
|
. $PSScriptRoot\meta.ps1
|
2021-08-23 15:24:05 +01:00
|
|
|
|
2022-01-19 21:52:59 +00:00
|
|
|
class Special {
|
2021-08-23 15:24:05 +01:00
|
|
|
# Constructor
|
|
|
|
Special()
|
|
|
|
{
|
2022-03-08 23:03:35 +00:00
|
|
|
AddActionMembers -PARAMS @('restart', 'shutdown', 'show')
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
2022-03-08 23:03:35 +00:00
|
|
|
[Single] Getter($cmd) {
|
|
|
|
return Param_Get -PARAM $cmd -IS_STRING $false
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
2022-03-08 23:03:35 +00:00
|
|
|
[void] Setter($param, $val) {
|
|
|
|
if ($val -is [Boolean]) {
|
|
|
|
Param_Set -PARAM $param -VALUE $(if ($val) {1} else {0})
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Param_Set -PARAM $param -VALUE $val
|
|
|
|
}
|
|
|
|
}
|
2021-08-23 15:24:05 +01:00
|
|
|
|
|
|
|
[String] cmd ($arg) {
|
|
|
|
return "Command.$arg"
|
|
|
|
}
|
|
|
|
|
2022-03-08 23:03:35 +00:00
|
|
|
hidden $_hide = $($this | Add-Member ScriptProperty 'hide' `
|
|
|
|
{
|
|
|
|
$this._hide = $this.Setter($this.cmd('show'), $false)
|
|
|
|
}`
|
|
|
|
{}
|
|
|
|
)
|
|
|
|
|
2021-08-23 15:24:05 +01:00
|
|
|
hidden $_showvbanchat = $($this | Add-Member ScriptProperty 'showvbanchat' `
|
|
|
|
{
|
2022-01-09 14:24:09 +00:00
|
|
|
$this.Getter($this.cmd('DialogShow.VBANCHAT'))
|
2021-08-23 15:24:05 +01:00
|
|
|
}`
|
|
|
|
{
|
2022-01-09 14:24:09 +00:00
|
|
|
param( [bool]$arg )
|
|
|
|
$this._showvbanchat = $this.Setter($this.cmd('DialogShow.VBANCHAT'), $arg)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
hidden $_lock = $($this | Add-Member ScriptProperty 'lock' `
|
|
|
|
{
|
|
|
|
$this._lock = $this.Getter($this.cmd('lock'))
|
|
|
|
}`
|
|
|
|
{
|
|
|
|
param( [bool]$arg )
|
|
|
|
$this._lock = $this.Setter($this.cmd('lock'), $arg)
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-01-19 19:06:41 +00:00
|
|
|
Function Make_Command {
|
2021-08-23 15:24:05 +01:00
|
|
|
return [Special]::new()
|
|
|
|
}
|