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");
}
}
}
}