ShouldPrintFullName() static private method

static private ShouldPrintFullName ( Type type ) : bool
type Type
return bool
Esempio n. 1
0
        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();
            Type          returnType    = this.ReturnType;

            if (MonoMethod.ShouldPrintFullName(returnType))
            {
                stringBuilder.Append(returnType.ToString());
            }
            else
            {
                stringBuilder.Append(returnType.Name);
            }
            stringBuilder.Append(" ");
            stringBuilder.Append(this.Name);
            if (this.IsGenericMethod)
            {
                Type[] genericArguments = this.GetGenericArguments();
                stringBuilder.Append("[");
                for (int i = 0; i < genericArguments.Length; i++)
                {
                    if (i > 0)
                    {
                        stringBuilder.Append(",");
                    }
                    stringBuilder.Append(genericArguments[i].Name);
                }
                stringBuilder.Append("]");
            }
            stringBuilder.Append("(");
            ParameterInfo[] parameters = this.GetParameters();
            for (int j = 0; j < parameters.Length; j++)
            {
                if (j > 0)
                {
                    stringBuilder.Append(", ");
                }
                Type type    = parameters[j].ParameterType;
                bool isByRef = type.IsByRef;
                if (isByRef)
                {
                    type = type.GetElementType();
                }
                if (MonoMethod.ShouldPrintFullName(type))
                {
                    stringBuilder.Append(type.ToString());
                }
                else
                {
                    stringBuilder.Append(type.Name);
                }
                if (isByRef)
                {
                    stringBuilder.Append(" ByRef");
                }
            }
            if ((this.CallingConvention & CallingConventions.VarArgs) != (CallingConventions)0)
            {
                if (parameters.Length > 0)
                {
                    stringBuilder.Append(", ");
                }
                stringBuilder.Append("...");
            }
            stringBuilder.Append(")");
            return(stringBuilder.ToString());
        }