static string GetSignatureForDoc(Type type)
{
#if GMCS_SOURCE
if (TypeManager.IsGenericParameter(type))
{
return((type.DeclaringMethod != null ? "``" : "`") + TypeManager.GenericParameterPosition(type));
}
if (TypeManager.IsGenericType(type))
{
string g = type.Namespace;
if (g != null && g.Length > 0)
{
g += '.';
}
int idx = type.Name.LastIndexOf('`');
g += (idx < 0 ? type.Name : type.Name.Substring(0, idx)) + '{';
int argpos = 0;
foreach (Type t in type.GetGenericArguments())
{
g += (argpos++ > 0 ? "," : String.Empty) + GetSignatureForDoc(t);
}
g += '}';
return(g);
}
#endif
string name = type.FullName != null ? type.FullName : type.Name;
return(name.Replace("+", ".").Replace('&', '@'));
}