mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 05:10:48 +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
|
||||
Special()
|
||||
{
|
||||
AddCommandMembers -PARAMS @('restart', 'shutdown', 'show')
|
||||
AddActionMembers -PARAMS @('restart', 'shutdown', 'show')
|
||||
}
|
||||
|
||||
[String] Getter($param) {
|
||||
return Write-Warning("ERROR: Usage: $param")
|
||||
[Single] Getter($cmd) {
|
||||
return Param_Get -PARAM $cmd -IS_STRING $false
|
||||
}
|
||||
|
||||
[void] Setter($param, $val = $true) {
|
||||
[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
|
||||
}
|
||||
}
|
||||
|
||||
[String] cmd ($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' `
|
||||
{
|
||||
$this.Getter($this.cmd('DialogShow.VBANCHAT'))
|
||||
|
Loading…
Reference in New Issue
Block a user