コード例 #1
0
 private SignatureHelper(Module mod, System.Reflection.MdSigCallingConvention callingConvention, int cGenericParameters, Type returnType, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers)
 {
     this.Init(mod, callingConvention, cGenericParameters);
     if (callingConvention == (System.Reflection.MdSigCallingConvention.Default | System.Reflection.MdSigCallingConvention.FastCall | System.Reflection.MdSigCallingConvention.StdCall))
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldSig"));
     }
     this.AddOneArgTypeHelper(returnType, requiredCustomModifiers, optionalCustomModifiers);
 }
コード例 #2
0
        public static SignatureHelper GetPropertySigHelper(Module mod, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
        {
            if (returnType == null)
            {
                returnType = typeof(void);
            }
            System.Reflection.MdSigCallingConvention convention = System.Reflection.MdSigCallingConvention.Default | System.Reflection.MdSigCallingConvention.Property;
            if ((callingConvention & CallingConventions.HasThis) == CallingConventions.HasThis)
            {
                convention = (System.Reflection.MdSigCallingConvention)((byte)(convention | (System.Reflection.MdSigCallingConvention.Default | System.Reflection.MdSigCallingConvention.HasThis)));
            }
            SignatureHelper helper = new SignatureHelper(mod, convention, returnType, requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers);

            helper.AddArguments(parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers);
            return(helper);
        }
コード例 #3
0
 private void Init(Module mod, System.Reflection.MdSigCallingConvention callingConvention, int cGenericParam)
 {
     this.Init(mod);
     this.AddData((int)callingConvention);
     if ((callingConvention == (System.Reflection.MdSigCallingConvention.Default | System.Reflection.MdSigCallingConvention.FastCall | System.Reflection.MdSigCallingConvention.StdCall)) || (callingConvention == (System.Reflection.MdSigCallingConvention.Default | System.Reflection.MdSigCallingConvention.GenericInst)))
     {
         this.m_sizeLoc = -1;
     }
     else
     {
         if (cGenericParam > 0)
         {
             this.AddData(cGenericParam);
         }
         this.m_sizeLoc = this.m_currSig++;
     }
 }
コード例 #4
0
        internal static SignatureHelper GetMethodSigHelper(Module scope, CallingConventions callingConvention, int cGenericParam, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
        {
            if (returnType == null)
            {
                returnType = typeof(void);
            }
            System.Reflection.MdSigCallingConvention convention = System.Reflection.MdSigCallingConvention.Default;
            if ((callingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs)
            {
                convention = System.Reflection.MdSigCallingConvention.C | System.Reflection.MdSigCallingConvention.FastCall;
            }
            if (cGenericParam > 0)
            {
                convention = (System.Reflection.MdSigCallingConvention)((byte)(convention | (System.Reflection.MdSigCallingConvention.Default | System.Reflection.MdSigCallingConvention.Generic)));
            }
            if ((callingConvention & CallingConventions.HasThis) == CallingConventions.HasThis)
            {
                convention = (System.Reflection.MdSigCallingConvention)((byte)(convention | (System.Reflection.MdSigCallingConvention.Default | System.Reflection.MdSigCallingConvention.HasThis)));
            }
            SignatureHelper helper = new SignatureHelper(scope, convention, cGenericParam, returnType, requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers);

            helper.AddArguments(parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers);
            return(helper);
        }
コード例 #5
0
 private void Init(Module mod, System.Reflection.MdSigCallingConvention callingConvention)
 {
     this.Init(mod, callingConvention, 0);
 }
コード例 #6
0
 private SignatureHelper(Module mod, System.Reflection.MdSigCallingConvention callingConvention, Type returnType, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers) : this(mod, callingConvention, 0, returnType, requiredCustomModifiers, optionalCustomModifiers)
 {
 }
コード例 #7
0
 private SignatureHelper(Module mod, System.Reflection.MdSigCallingConvention callingConvention)
 {
     this.Init(mod, callingConvention);
 }