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"); } } } }
static void WriteType( HtmlTextWriter wrtr, Type type, bool isparams, ArrayList structs) { // TODO: following is hack for case when type is Object string xmlRpcType; if (!isparams) { if (type != typeof(Object)) { xmlRpcType = XmlRpcServiceInfo.GetXmlRpcTypeString(type); } else { xmlRpcType = "any"; } } else { xmlRpcType = "varargs"; } 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" || xmlRpcType == "varargs") { if (type.GetArrayRank() == 1) // single dim array { wrtr.Write(" of "); Type elemType = type.GetElementType(); string elemXmlRpcType; if (elemType != typeof(Object)) { elemXmlRpcType = XmlRpcServiceInfo.GetXmlRpcTypeString(elemType); } else { elemXmlRpcType = "any"; } 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"); } } } }