示例#1
0
        // Custom methods

        public int GetParamCount(uint methodToken)
        {
            int count = 0;

            foreach (uint param in EnumParams(methodToken))
            {
                ParamProps paramProps = GetParamProps(param);
                // Zero is special parameter representing the return parameter
                if (paramProps.Sequence != 0)
                {
                    count++;
                }
            }
            return(count);
        }
示例#2
0
        public ParamProps GetParamProps(uint paramToken)
        {
            ParamProps paramProps = new ParamProps();

            paramProps.Token = paramToken;
            paramProps.Name  =
                Util.GetString(delegate(uint pStringLenght, out uint stringLenght, System.IntPtr pString) {
                uint unused;
                metaData.GetParamProps(paramProps.Token,
                                       out paramProps.MethodToken,
                                       out paramProps.ParameterSequence,
                                       pString, pStringLenght, out stringLenght,                         // The string to get
                                       out paramProps.Flags,
                                       out unused,
                                       IntPtr.Zero,
                                       out unused);
            });

            return(paramProps);
        }
示例#3
0
        public ParamProps GetParamProps(uint paramToken)
        {
            ParamProps ret       = new ParamProps();
            IntPtr     constPtr  = IntPtr.Zero;
            uint       constSize = 0;

            ret.ParamDef = paramToken;
            ret.Name     = Util.GetString(delegate(uint pStringLenght, out uint stringLenght, System.IntPtr pString) {
                metaData.GetParamProps(
                    ret.ParamDef,
                    out ret.MethodDef,
                    out ret.Sequence,
                    pString, pStringLenght, out stringLenght,                     // The string to get
                    out ret.Flags,
                    out ret.CPlusTypeFlag,
                    out constPtr,
                    out constSize
                    );
            });
            ret.Constant = new Blob(constPtr, constSize);
            return(ret);
        }