示例#1
0
 public DynamicMemberHandle(PropertyInfo info) :
     this(
         info.Name,
         info.PropertyType,
         DynamicMethodHandlerFactory.CreatePropertyGetter(info),
         DynamicMethodHandlerFactory.CreatePropertySetter(info))
 {
 }
示例#2
0
 public DynamicMemberHandle(FieldInfo info) :
     this(
         info.Name,
         info.FieldType,
         DynamicMethodHandlerFactory.CreateFieldGetter(info),
         DynamicMethodHandlerFactory.CreateFieldSetter(info))
 {
 }
示例#3
0
        public DynamicMethodHandle(MethodInfo method)
        {
            if (method == null)
            {
                throw new ArgumentNullException("info");
            }

            this.Method = method;
            var parameters = method.GetParameters();

            this.MethodParamsLength = parameters.Length;

            if (MethodCaller.IsLastArray(parameters))
            {
                this.HasFinalArrayParam    = true;
                this.FinalArrayElementType = parameters[parameters.Length - 1].ParameterType.GetElementType();
            }
            this.DynamicMethod = DynamicMethodHandlerFactory.CreateMethod(method);
        }