コード例 #1
0
ファイル: TypeInfoExtensions.cs プロジェクト: NN---/Theraot
        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));
        }
コード例 #2
0
ファイル: TypeInfoExtensions.cs プロジェクト: NN---/Theraot
 public static Type MakeDelegateType(this DelegateHelpers.TypeInfo info, Type retType, params Expression[] args)
 {
     return(info.MakeDelegateType(retType, (IList <Expression>)args));
 }