Exemple #1
0
        private string FormatNameAndSig(bool serialization)
        {
            StringBuilder sbName = new StringBuilder(PropertyType.FormatTypeName(serialization));

            sbName.Append(" ");
            sbName.Append(Name);

            var pi = GetIndexParameters();

            if (pi.Length > 0)
            {
                sbName.Append(" [");
                MonoParameterInfo.FormatParameters(sbName, pi, 0, serialization);
                sbName.Append("]");
            }

            return(sbName.ToString());
        }
Exemple #2
0
        internal override string FormatNameAndSig(bool serialization)
        {
            // Serialization uses ToString to resolve MethodInfo overloads.
            StringBuilder sbName = new StringBuilder(Name);

            // serialization == true: use unambiguous (except for assembly name) type names to distinguish between overloads.
            // serialization == false: use basic format to maintain backward compatibility of MethodInfo.ToString().
            TypeNameFormatFlags format = serialization ? TypeNameFormatFlags.FormatSerialization : TypeNameFormatFlags.FormatBasic;

            if (IsGenericMethod)
            {
                sbName.Append(RuntimeMethodHandle.ConstructInstantiation(this, format));
            }

            sbName.Append("(");
            MonoParameterInfo.FormatParameters(sbName, GetParametersNoCopy(), CallingConvention, serialization);
            sbName.Append(")");

            return(sbName.ToString());
        }
Exemple #3
0
        private string FormatNameAndSig(bool serialization)
        {
#if NETCORE
            throw new NotImplementedException();
#else
            StringBuilder sbName = new StringBuilder(PropertyType.FormatTypeName(serialization));

            sbName.Append(" ");
            sbName.Append(Name);

            var pi = GetIndexParameters();
            if (pi.Length > 0)
            {
                sbName.Append(" [");
                MonoParameterInfo.FormatParameters(sbName, pi, 0, serialization);
                sbName.Append("]");
            }

            return(sbName.ToString());
#endif
        }