Example #1
0
        public CallMethodILCode(ILCodeParameter instance, MethodInfo method, params ILCodeParameter[] parameters)
        {
            if (instance == null && !method.IsStatic)
                throw new ArgumentException("Instance must be provided for instance methods");
            if (instance != null && method.IsStatic)
                throw new ArgumentException("Static method may not be invoked with an instance");

            _methodParameters = method.GetParameters();

            if (_methodParameters.Length < parameters.Length)
                throw new ArgumentException("The parameter length supplied is greater than the method supports");

            _instance = instance;
            _method = method;
            _parameters = parameters;
            _returnType = method.ReturnType;
        }
        public NullableILCodeParameter(IILCodeParameter parameter)
        {
            if (parameter.ParameterType == null) throw new NotSupportedException("The parameter does not have a well defined parameter type");

            _parameter = parameter;
        }
Example #3
0
 public CastILCodeParameter(IILCodeParameter parameter, Type toType)
 {
     _parameter = parameter;
     _toType = toType;
 }