mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 13:20:47 +00:00
Update command.ps1
add hide member refactor setter
This commit is contained in:
parent
9a42fadd09
commit
10c326a2f5
@ -4,21 +4,33 @@ class Special {
|
|||||||
# Constructor
|
# Constructor
|
||||||
Special()
|
Special()
|
||||||
{
|
{
|
||||||
AddCommandMembers -PARAMS @('restart', 'shutdown', 'show')
|
AddActionMembers -PARAMS @('restart', 'shutdown', 'show')
|
||||||
}
|
}
|
||||||
|
|
||||||
[String] Getter($param) {
|
[Single] Getter($cmd) {
|
||||||
return Write-Warning("ERROR: Usage: $param")
|
return Param_Get -PARAM $cmd -IS_STRING $false
|
||||||
}
|
}
|
||||||
|
|
||||||
[void] Setter($param, $val = $true) {
|
[void] Setter($param, $val) {
|
||||||
Param_Set -PARAM $param -VALUE $(if ($val) {1} else {0})
|
if ($val -is [Boolean]) {
|
||||||
}
|
Param_Set -PARAM $param -VALUE $(if ($val) {1} else {0})
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Param_Set -PARAM $param -VALUE $val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[String] cmd ($arg) {
|
[String] cmd ($arg) {
|
||||||
return "Command.$arg"
|
return "Command.$arg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hidden $_hide = $($this | Add-Member ScriptProperty 'hide' `
|
||||||
|
{
|
||||||
|
$this._hide = $this.Setter($this.cmd('show'), $false)
|
||||||
|
}`
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
|
||||||
hidden $_showvbanchat = $($this | Add-Member ScriptProperty 'showvbanchat' `
|
hidden $_showvbanchat = $($this | Add-Member ScriptProperty 'showvbanchat' `
|
||||||
{
|
{
|
||||||
$this.Getter($this.cmd('DialogShow.VBANCHAT'))
|
$this.Getter($this.cmd('DialogShow.VBANCHAT'))
|
||||||
|
Loading…
Reference in New Issue
Block a user