Inheritance: TargetMemberInfo
Example #1
0
        protected string FormatMethod(string prefix, TargetMethodInfo method,
					       bool is_static, bool is_ctor, Hashtable hash)
        {
            StringBuilder sb = new StringBuilder ();
            sb.Append (prefix);
            if (is_ctor)
                if (is_static)
                    sb.Append ("   .cctor ");
                else
                    sb.Append ("   .ctor ");
            else if (is_static)
                sb.Append ("   static ");
            else
                sb.Append ("   ");

            TargetFunctionType ftype = method.Type;
            if (!is_ctor) {
                if (ftype.HasReturnValue)
                    sb.Append (ftype.ReturnType != null ?
                           ftype.ReturnType.Name : "<unknown type>");
                else
                    sb.Append ("void");
                sb.Append (" ");
                sb.Append (method.Name);
                sb.Append (" ");
            }
            sb.Append ("(");
            bool first = true;
            foreach (TargetType ptype in ftype.ParameterTypes) {
                if (first)
                    first = false;
                else
                    sb.Append (", ");
                sb.Append (ptype != null ? ptype.Name : "<unknown type>");
            }
            sb.Append (");\n");
            return sb.ToString ();
        }