Ejemplo n.º 1
0
        public void EmitCalli(OpCode opc, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type[] optionalParameterTypes)
        {
            SignatureHelper sig = SignatureHelper.GetMethodSigHelper(moduleBuilder, callingConvention, returnType);

            sig.AddArguments(parameterTypes, null, null);
            if (optionalParameterTypes != null && optionalParameterTypes.Length != 0)
            {
                sig.AddSentinel();
                sig.AddArguments(optionalParameterTypes, null, null);
            }
            Emit(opc, sig);
        }
Ejemplo n.º 2
0
        public void EmitCalli(OpCode opc, CallingConvention callingConvention, Type returnType, Type[] parameterTypes)
        {
            SignatureHelper sig = SignatureHelper.GetMethodSigHelper(moduleBuilder, callingConvention, returnType);

            sig.AddArguments(parameterTypes, null, null);
            Emit(opc, sig);
        }
Ejemplo n.º 3
0
        public static SignatureHelper GetMethodSigHelper(Module mod, Type returnType, Type[] parameterTypes)
        {
            SignatureHelper sig = Create(mod, 0, returnType);

            sig.AddArgument(returnType);
            sig.paramCount = 0;
            sig.AddArguments(parameterTypes, null, null);
            return(sig);
        }
Ejemplo n.º 4
0
        public static SignatureHelper GetPropertySigHelper(Module mod, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
        {
            SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, Signature.PROPERTY);

            sig.callingConvention         = callingConvention;
            sig.returnType                = returnType;
            sig.returnTypeCustomModifiers = CustomModifiers.FromReqOpt(requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers);
            sig.AddArguments(parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers);
            return(sig);
        }
Ejemplo n.º 5
0
        public static SignatureHelper GetPropertySigHelper(Module mod, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
        {
            byte type = Signature.PROPERTY;

            if ((callingConvention & CallingConventions.HasThis) != 0)
            {
                type |= Signature.HASTHIS;
            }
            SignatureHelper sig = Create(mod, type, returnType);

            sig.AddArgument(returnType, requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers);
            sig.paramCount = 0;
            sig.AddArguments(parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers);
            return(sig);
        }
Ejemplo n.º 6
0
		public static SignatureHelper GetPropertySigHelper(Module mod, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
		{
			SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, Signature.PROPERTY);
			sig.callingConvention = callingConvention;
			sig.returnType = returnType;
			sig.returnTypeOptionalCustomModifiers = requiredReturnTypeCustomModifiers;
			sig.returnTypeRequiredCustomModifiers = optionalReturnTypeCustomModifiers;
			sig.AddArguments(parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers);
			return sig;
		}