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


C# UPnPStateVariable.GetNetType方法代码示例

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


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

示例1: ToCTypeFromStateVar_Dispatch

 public static string ToCTypeFromStateVar_Dispatch(UPnPStateVariable V)
 {
     if (V.ComplexType == null)
     {
         string RetVal = V.Name;
         if (Static_ToCType(V.GetNetType().ToString()) == "unsigned char*")
         {
             RetVal += ", " + V.Name + "Length";
         }
         return (RetVal);
     }
     else
     {
         return (V.Name);
     }
 }
开发者ID:evolution124,项目名称:Developer-Tools-for-UPnP-Technologies,代码行数:16,代码来源:EmbeddedCGenerator.cs

示例2: ToCTypeFromStateVar_Serialize

        public static string ToCTypeFromStateVar_Serialize(string InVar, string InVarLength, string OK, string LibPrefix, UPnPStateVariable A)
        {
            StringBuilder cs = new StringBuilder();

            if (OK != "")
            {
                OK = OK + " = ";
            }

            switch (A.GetNetType().FullName)
            {
                case "System.DateTime":
                    cs.Append("	" + A.Name + " = " + LibPrefix + "Time_Parse(" + InVar + ");" + cl);
                    break;
                case "System.SByte":
                case "System.Int16":
                case "System.Int32":
                    cs.Append("	" + OK + LibPrefix + "GetLong(" + InVar + ", " + InVarLength + ", (long*)&" + A.Name + ");" + cl);
                    break;
                case "System.Byte":
                case "System.UInt16":
                case "System.UInt32":
                    cs.Append("	" + OK + LibPrefix + "GetULong(" + InVar + ", " + InVarLength + ", (unsigned long*)&" + A.Name + ");" + cl);
                    break;
                case "System.Boolean":
                    if (OK != "")
                    {
                        cs.Append(OK + "0;" + cl);
                    }
                    cs.Append("	if (" + InVarLength + "==4)" + cl);
                    cs.Append("	{" + cl);
                    cs.Append("		if (strncasecmp(" + InVar + ", \"true\", 4)==0)" + cl);
                    cs.Append("		{" + cl);
                    if (OK != "")
                    {
                        cs.Append(OK + "1;" + cl);
                    }
                    cs.Append("			" + A.Name + " = 1;" + cl);
                    cs.Append("		}" + cl);
                    cs.Append("	}" + cl);
                    cs.Append("	if (" + InVarLength + " == 5)" + cl);
                    cs.Append("	{" + cl);
                    cs.Append("		if (strncasecmp(" + InVar + ", \"false\", 5)==0)" + cl);
                    cs.Append("		{" + cl);
                    if (OK != "")
                    {
                        cs.Append(OK + "1;" + cl);
                    }
                    cs.Append("			" + A.Name + " = 0;" + cl);
                    cs.Append("		}" + cl);
                    cs.Append("	}" + cl);
                    cs.Append("	if (" + InVarLength + " == 1)" + cl);
                    cs.Append("	{" + cl);
                    cs.Append("		if (memcmp(" + InVar + ", \"0\", 1) == 0)" + cl);
                    cs.Append("		{" + cl);
                    if (OK != "")
                    {
                        cs.Append(OK + "1;" + cl);
                    }
                    cs.Append("			" + A.Name + " = 0;" + cl);
                    cs.Append("		}" + cl);
                    cs.Append("		if (memcmp(" + InVar + ", \"1\", 1) == 0)" + cl);
                    cs.Append("		{" + cl);
                    if (OK != "")
                    {
                        cs.Append(OK + "1;" + cl);
                    }
                    cs.Append("			" + A.Name + " = 1;" + cl);
                    cs.Append("		}" + cl);
                    cs.Append("	}" + cl);
                    break;
                case "System.Byte[]":
                    cs.Append(A.Name + "Length = " + LibPrefix + "Base64Decode(" + InVar + ", " + InVarLength + ", &" + A.Name + ");" + cl);
                    break;
                case "System.Uri":
                case "System.String":
                default:
                    if (A.ComplexType == null)
                    {
                        cs.Append("	" + A.Name + "Length = " + LibPrefix + "InPlaceXmlUnEscape(" + InVar + ");" + cl);
                        cs.Append("	" + A.Name + " = " + InVar + ";" + cl);
                    }
                    else
                    {
                        cs.Append(cl + "//ToDo: DeviceBuilder needs to be modified to include a ComplexTypeParsre here!");
                    }
                    break;
            }
            return (cs.ToString());
        }
开发者ID:evolution124,项目名称:Developer-Tools-for-UPnP-Technologies,代码行数:90,代码来源:EmbeddedCGenerator.cs

示例3: ToCTypeFromStateVar

 public static string ToCTypeFromStateVar(UPnPStateVariable V)
 {
     if (V.ComplexType == null)
     {
         string RetVal = Static_ToCType(V.GetNetType().ToString()) + " " + V.Name;
         if (Static_ToCType(V.GetNetType().ToString()) == "unsigned char*")
         {
             RetVal += ", int " + V.Name + "Length";
         }
         return (RetVal);
     }
     else
     {
         return ("struct " + V.ComplexType.Name_LOCAL + "* " + V.Name);
     }
 }
开发者ID:evolution124,项目名称:Developer-Tools-for-UPnP-Technologies,代码行数:16,代码来源:EmbeddedCGenerator.cs


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