MakeNewDelegate() 개인적인 메소드

private MakeNewDelegate ( Type types ) : Type
types Type
리턴 Type
예제 #1
0
 public Type MakeDelegateType(Type retType, IList <Expression> args)
 {
     Type[] types = new Type[args.Count + 2];
     types[0] = typeof(CallSite);
     types[types.Length - 1] = retType;
     for (int i = 0; i < args.Count; i++)
     {
         types[i + 1] = args[i].Type;
     }
     return(this.DelegateType = DelegateHelpers.MakeNewDelegate(types));
 }
예제 #2
0
        public static Type MakeDelegateType(this DelegateHelpers.TypeInfo info, Type retType, IList <Expression> args)
        {
            // nope, go ahead and create it and spend the
            // cost of creating the array.
            Type[] paramTypes = new Type[args.Count + 2];
            paramTypes[0] = typeof(CallSite);
            paramTypes[paramTypes.Length - 1] = retType;
            for (int i = 0; i < args.Count; i++)
            {
                paramTypes[i + 1] = args[i].Type;
            }

            return(info.DelegateType = DelegateHelpers.MakeNewDelegate(paramTypes));
        }