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
|
2022-10-27 21:20:03 +01:00
|
|
|
Special () {
|
2022-03-08 23:03:35 +00:00
|
|
|
AddActionMembers -PARAMS @('restart', 'shutdown', 'show')
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[string] ToString() {
|
|
|
|
return $this.GetType().Name
|
|
|
|
}
|
|
|
|
|
|
|
|
[single] Getter ($cmd) {
|
2022-03-08 23:03:35 +00:00
|
|
|
return Param_Get -PARAM $cmd -IS_STRING $false
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[void] Setter ($param, $val) {
|
2022-03-08 23:03:35 +00:00
|
|
|
if ($val -is [Boolean]) {
|
2022-10-27 21:20:03 +01:00
|
|
|
Param_Set -PARAM $param -Value $(if ($val) { 1 } else { 0 })
|
2022-03-08 23:03:35 +00:00
|
|
|
}
|
|
|
|
else {
|
2022-10-27 21:20:03 +01:00
|
|
|
Param_Set -PARAM $param -Value $val
|
2022-03-08 23:03:35 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-23 15:24:05 +01:00
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[string] cmd ($arg) {
|
2021-08-23 15:24:05 +01:00
|
|
|
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)
|
2022-10-27 21:20:03 +01:00
|
|
|
} `
|
2022-03-08 23:03:35 +00:00
|
|
|
{}
|
|
|
|
)
|
|
|
|
|
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'))
|
2022-10-27 21:20:03 +01:00
|
|
|
} `
|
2021-08-23 15:24:05 +01:00
|
|
|
{
|
2022-10-27 21:20:03 +01:00
|
|
|
param([bool]$arg)
|
2022-01-09 14:24:09 +00:00
|
|
|
$this._showvbanchat = $this.Setter($this.cmd('DialogShow.VBANCHAT'), $arg)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
hidden $_lock = $($this | Add-Member ScriptProperty 'lock' `
|
|
|
|
{
|
|
|
|
$this._lock = $this.Getter($this.cmd('lock'))
|
2022-10-27 21:20:03 +01:00
|
|
|
} `
|
2022-01-09 14:24:09 +00:00
|
|
|
{
|
2022-10-27 21:20:03 +01:00
|
|
|
param([bool]$arg)
|
2022-01-09 14:24:09 +00:00
|
|
|
$this._lock = $this.Setter($this.cmd('lock'), $arg)
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
)
|
2022-12-14 19:37:11 +00:00
|
|
|
|
|
|
|
[void] Load ([string]$filename) {
|
|
|
|
$this.Setter($this.cmd('load'), $filename)
|
|
|
|
}
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function Make_Command {
|
2021-08-23 15:24:05 +01:00
|
|
|
return [Special]::new()
|
|
|
|
}
|