CookComputing.XmlRpc.XmlRpcServiceInfo.GetXmlRpcTypeString C# (CSharp) Method

GetXmlRpcTypeString() public static method

public static GetXmlRpcTypeString ( Type t ) : string
t System.Type
return string
        public static string GetXmlRpcTypeString(Type t)
        {
            XmlRpcType rpcType = GetXmlRpcType(t);
              return GetXmlRpcTypeString(rpcType);
        }

Same methods

XmlRpcServiceInfo::GetXmlRpcTypeString ( XmlRpcType t ) : string

Usage Example

Esempio n. 1
0
        static void WriteType(
            HtmlTextWriter wrtr,
            Type type,
            ArrayList structs)
        {
            // TODO: following is hack for case when type is Object
            string xmlRpcType;

            if (type != typeof(Object))
            {
                xmlRpcType = XmlRpcServiceInfo.GetXmlRpcTypeString(type);
            }
            else
            {
                xmlRpcType = "any";
            }
            wrtr.Write(xmlRpcType);
            if (xmlRpcType == "struct" && type != typeof(XmlRpcStruct))
            {
                if (!structs.Contains(type))
                {
                    structs.Add(type);
                }
                wrtr.Write(" ");
                wrtr.WriteBeginTag("a");
                wrtr.WriteAttribute("href", "#" + type.Name);
                wrtr.Write(HtmlTextWriter.TagRightChar);
                wrtr.Write(type.Name);
                wrtr.WriteEndTag("a");
            }
            else if (xmlRpcType == "array")
            {
                string[] checkSingleDim = Regex.Split(type.FullName, "\\[\\]$");
                if (checkSingleDim.Length > 1) // single dim array
                {
                    Type     elemType     = null;
                    Assembly asmbly       = type.Assembly;
                    string[] asmblyName   = asmbly.FullName.Split(',');
                    string   elemTypeName = checkSingleDim[0] + ", " + asmblyName[0];
                    elemType = Type.GetType(elemTypeName);

                    wrtr.Write(" of ");
                    string elemXmlRpcType
                        = XmlRpcServiceInfo.GetXmlRpcTypeString(elemType);
                    wrtr.Write(elemXmlRpcType);

                    if (elemXmlRpcType == "struct" && elemType != typeof(XmlRpcStruct))
                    {
                        if (!structs.Contains(elemType))
                        {
                            structs.Add(elemType);
                        }
                        wrtr.Write(" ");
                        wrtr.WriteBeginTag("a");
                        wrtr.WriteAttribute("href", "#" + elemType.Name);
                        wrtr.Write(HtmlTextWriter.TagRightChar);
                        wrtr.Write(elemType.Name);
                        wrtr.WriteEndTag("a");
                    }
                }
            }
        }
All Usage Examples Of CookComputing.XmlRpc.XmlRpcServiceInfo::GetXmlRpcTypeString