Inheritance: ParameterInfo
コード例 #1
0
        public override ParameterInfo[] GetIndexParameters()
        {
            CachePropertyInfo(PInfo.GetMethod | PInfo.SetMethod);
            ParameterInfo[] src;
            int             length;

            if (info.get_method != null)
            {
                src    = info.get_method.GetParametersInternal();
                length = src.Length;
            }
            else if (info.set_method != null)
            {
                src    = info.set_method.GetParametersInternal();
                length = src.Length - 1;
            }
            else
            {
                return(EmptyArray <ParameterInfo> .Value);
            }

            var dest = new ParameterInfo [length];

            for (int i = 0; i < length; ++i)
            {
                dest [i] = MonoParameterInfo.New(src [i], this);
            }
            return(dest);
        }
コード例 #2
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());
        }
コード例 #3
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());
        }
コード例 #4
0
ファイル: MonoProperty.cs プロジェクト: marcinm100/mono
        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
        }
コード例 #5
0
 static internal ParameterInfo GetReturnParameterInfo(MonoMethod method)
 {
     return(MonoParameterInfo.New(GetReturnType(method.mhandle), method, get_retval_marshal(method.mhandle)));
 }