本文整理汇总了C#中OpenSource.UPnP.UPnPService.GetAction方法的典型用法代码示例。如果您正苦于以下问题:C# UPnPService.GetAction方法的具体用法?C# UPnPService.GetAction怎么用?C# UPnPService.GetAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSource.UPnP.UPnPService
的用法示例。
在下文中一共展示了UPnPService.GetAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvokeAsync
public void InvokeAsync(UPnPService S, string Action, byte[] InArgs, string Caller, int Handle)
{
UPnPAction A = S.GetAction(Action);
ArrayList AList = new ArrayList();
foreach(UPnPArgument arg in A.ArgumentList)
{
if(arg.IsReturnValue==false && arg.Direction=="out")
{
UPnPArgument _arg = (UPnPArgument)arg.Clone();
_arg.DataValue = UPnPService.CreateObjectInstance(arg.RelatedStateVar.GetNetType(),null);
AList.Add(_arg);
}
}
UPnPArgument[] Temp = ParseArguments(InArgs);
foreach(UPnPArgument _arg in Temp)
{
_arg.DataType = A.GetArg(_arg.Name).RelatedStateVar.ValueType;
_arg.Direction = "in";
AList.Add(_arg);
}
UPnPArgument[] Arguments = (UPnPArgument[])AList.ToArray(typeof(UPnPArgument));
(new UPnPDebugObject(S)).SetProperty("ValidationMode",false);
S.InvokeAsync(Action,Arguments,new Object[2]{Caller,Handle},A_ICB,A_IECB);
}
示例2: A_InvokeSink
private void A_InvokeSink(UPnPService sender, String MethodName, UPnPArgument[] Args, Object ReturnValue, object Tag)
{
object[] state = (object[])Tag;
string Caller = (string)state[0];
int Handle = (int)state[1];
ArrayList RetList = new ArrayList();
UPnPAction A = sender.GetAction(MethodName);
if(A.HasReturnValue==true)
{
UPnPArgument RA = (UPnPArgument)A.GetRetArg().Clone();
RA.DataValue = ReturnValue;
RetList.Add(RA);
}
foreach(UPnPArgument OA in Args)
{
if(OA.Direction=="out")
{
RetList.Add(OA);
}
}
byte[] OutArgs = BuildArguments((UPnPArgument[])RetList.ToArray(typeof(UPnPArgument)));
CpGateKeeper C = (CpGateKeeper)RegisteredTable[Caller];
C.InvokeAsyncResponse(Handle,OutArgs,0,"");
}
示例3: Invoke
public void Invoke(UPnPService S, string Action, byte[] InArgs, out byte[] OutArgs)
{
UPnPAction A = S.GetAction(Action);
ArrayList AList = new ArrayList();
foreach(UPnPArgument arg in A.ArgumentList)
{
if(arg.IsReturnValue==false && arg.Direction=="out")
{
UPnPArgument _arg = (UPnPArgument)arg.Clone();
_arg.DataValue = UPnPService.CreateObjectInstance(arg.RelatedStateVar.GetNetType(),null);
AList.Add(_arg);
}
}
UPnPArgument[] Temp = ParseArguments(InArgs);
foreach(UPnPArgument _arg in Temp)
{
_arg.DataType = A.GetArg(_arg.Name).RelatedStateVar.ValueType;
_arg.Direction = "in";
AList.Add(_arg);
}
UPnPArgument[] Arguments = (UPnPArgument[])AList.ToArray(typeof(UPnPArgument));
(new UPnPDebugObject(S)).SetProperty("ValidationMode",false);
object RetVal = null;
try
{
RetVal = S.InvokeSync(Action,Arguments);
}
catch(UPnPInvokeException ie)
{
if(ie.UPNP!=null)
{
throw(ie.UPNP);
}
else
{
throw(ie);
}
}
ArrayList RetList = new ArrayList();
if(A.HasReturnValue==true)
{
UPnPArgument RA = (UPnPArgument)A.GetRetArg().Clone();
RA.DataValue = RetVal;
RetList.Add(RA);
}
foreach(UPnPArgument OA in Arguments)
{
if(OA.Direction=="out")
{
RetList.Add(OA);
}
}
OutArgs = BuildArguments((UPnPArgument[])RetList.ToArray(typeof(UPnPArgument)));
}