当前位置: 首页>>代码示例>>C#>>正文


C# UPnPService.GetAction方法代码示例

本文整理汇总了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);
        }
开发者ID:amadare,项目名称:DeveloperToolsForUPnP,代码行数:28,代码来源:Gatekeeper.cs

示例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,"");
        }
开发者ID:amadare,项目名称:DeveloperToolsForUPnP,代码行数:27,代码来源:Gatekeeper.cs

示例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)));
        }
开发者ID:amadare,项目名称:DeveloperToolsForUPnP,代码行数:63,代码来源:Gatekeeper.cs


注:本文中的OpenSource.UPnP.UPnPService.GetAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。