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


C# UPnPService.AddMethod方法代码示例

本文整理汇总了C#中UPnPService.AddMethod方法的典型用法代码示例。如果您正苦于以下问题:C# UPnPService.AddMethod方法的具体用法?C# UPnPService.AddMethod怎么用?C# UPnPService.AddMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UPnPService的用法示例。


在下文中一共展示了UPnPService.AddMethod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildUPnPService

            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[3];
                RetVal[0] = new UPnPModeratedStateVariable("OysterConnectionPort", typeof(System.Int32), false);
                RetVal[0].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.Int32),"13075");
                RetVal[0].AddAssociation("GetConnectionVariables", "int32ConnectionPort");
                RetVal[1] = new UPnPModeratedStateVariable("OysterFilePort", typeof(System.Int32), false);
                RetVal[1].AddAssociation("GetConnectionVariables", "int32FilePort");
                RetVal[2] = new UPnPModeratedStateVariable("OysterConnectionAddress", typeof(System.String), false);
                RetVal[2].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"OysterMini");
                RetVal[2].AddAssociation("GetConnectionVariables", "stringConnectionAddress");

                UPnPService S = new UPnPService(1, "ConnectionService", "urn:schemas-upnp-org:OysterConnection::1", true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("GetConnectionVariables");
                return(S);
            }
开发者ID:CarverLab,项目名称:Oyster,代码行数:20,代码来源:OysterConnection.cs

示例2: BuildUPnPService

            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[5];
                RetVal[0] = new UPnPModeratedStateVariable("PageMax", typeof(System.Int32), true);
                RetVal[0].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.Int32),"1");
                RetVal[0].AddAssociation("PowerOn", "PageMax");
                RetVal[1] = new UPnPModeratedStateVariable("Power", typeof(System.Boolean), true);
                RetVal[1].AddAssociation("GetStatus", "Power");
                RetVal[1].AddAssociation("PowerOff", "Power");
                RetVal[1].AddAssociation("PowerOn", "Power");
                RetVal[2] = new UPnPModeratedStateVariable("File", typeof(System.String), true);
                RetVal[2].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"default.ppt");
                RetVal[2].AddAssociation("GetStatus", "File");
                RetVal[2].AddAssociation("PowerOn", "File");
                RetVal[3] = new UPnPModeratedStateVariable("PageNumber", typeof(System.Int32), true);
                RetVal[3].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.Int32),"1");
                RetVal[3].AddAssociation("GetStatus", "PageNumber");
                RetVal[3].AddAssociation("Go", "PageNumber");
                RetVal[3].AddAssociation("NextPage", "PageNumber");
                RetVal[3].AddAssociation("PowerOn", "PageNumber");
                RetVal[3].AddAssociation("PreviousPage", "PageNumber");
                RetVal[4] = new UPnPModeratedStateVariable("Files", typeof(System.String), true);
                RetVal[4].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"default.ppt");
                RetVal[4].AddAssociation("GetFiles", "Files");

                UPnPService S = new UPnPService(1, "control", "urn:schemas-upnp-org:service:control:1", true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("GetFiles");
                S.AddMethod("GetStatus");
                S.AddMethod("Go");
                S.AddMethod("NextPage");
                S.AddMethod("PowerOff");
                S.AddMethod("PowerOn");
                S.AddMethod("PreviousPage");
                return(S);
            }
开发者ID:kejadlen,项目名称:college,代码行数:39,代码来源:P504.cs


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