我有C#类
class ConfigurationPropertyBag : IPropertyBag
{
internal HybridDictionary properties;
internal ConfigurationPropertyBag()
{
properties = new HybridDictionary();
}
public void Read(string propName, out object ptrVar, int errLog)
{
ptrVar = properties[propName];
}
public void Write(string propName, ref object ptrVar)
{
properties.Add(propName, ptrVar);
}
}
实现接口IPropertyBag。我想在PowerShell中编写这个类,但我不知道如何在函数Read中定义out object ptrVar
。
class ConfigurationPropertyBag : Microsoft.BizTalk.SSOClient.Interop.IPropertyBag
{
[System.Collections.Specialized.HybridDictionary] $properties;
ConfigurationPropertyBag()
{
$this.properties = new-object System.Collections.Specialized.HybridDictionary
}
[void] Read([string]$propName, [out]$ptrVar, [int]$errLog)
{
$ptrVar = $this.properties[$propName];
}
[void] Write([string]$propName, [ref]$ptrVar)
{
$this.properties.Add($propName, $ptrVar);
}
}
[out]$ptrVar
返回错误。有什么想法吗?