예제 #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(Array.Empty <ParameterInfo>());
            }

            var dest = new ParameterInfo[length];

            for (int i = 0; i < length; ++i)
            {
                dest[i] = RuntimeParameterInfo.New(src[i], this);
            }
            return(dest);
        }
예제 #2
0
 internal static ParameterInfo GetReturnParameterInfo(RuntimeMethodInfo method)
 {
     return(RuntimeParameterInfo.New(GetReturnType(method.mhandle), method, get_retval_marshal(method.mhandle)));
 }