mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-18 13:33:31 +00:00
update to class getters/setters and meta module
rename factory functions. class getters now send is_string parameter. each property type for each class now has separate meta function.
This commit is contained in:
@@ -1,25 +1,10 @@
|
||||
. $PSScriptRoot\meta.ps1
|
||||
|
||||
class Special {
|
||||
hidden AddPublicMembers($commands) {
|
||||
$commands | ForEach-Object {
|
||||
# Define getter
|
||||
$GetterSignature = "`$this.Getter(`$this.cmd('{0}'))" -f $_
|
||||
# Define setter
|
||||
$SetterSignature = "`$this.Setter(`$this.cmd('{0}'))" -f $_
|
||||
|
||||
$AddMemberParams = @{
|
||||
Name = $_
|
||||
MemberType = 'ScriptProperty'
|
||||
Value = [ScriptBlock]::Create($SetterSignature)
|
||||
SecondValue = [ScriptBlock]::Create($GetterSignature)
|
||||
}
|
||||
$this | Add-Member @AddMemberParams
|
||||
}
|
||||
}
|
||||
|
||||
# Constructor
|
||||
Special()
|
||||
{
|
||||
$this.AddPublicMembers(@('restart', 'shutdown', 'show'))
|
||||
AddCommandMembers -PARAMS @('restart', 'shutdown', 'show')
|
||||
}
|
||||
|
||||
[String] Getter($param) {
|
||||
|
||||
Reference in New Issue
Block a user