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