Expression.GetFuncType(Type[]) 方法

定義

建立 Type 物件,這個物件代表具有特定型別引數的泛型 System.Func 委派類型。Creates a Type object that represents a generic System.Func delegate type that has specific type arguments. 最後一個類型引數指定已建立之委派的傳回類型。The last type argument specifies the return type of the created delegate.

public:
 static Type ^ GetFuncType(... cli::array <Type ^> ^ typeArgs);
public static Type GetFuncType (params Type[] typeArgs);
public static Type GetFuncType (params Type[]? typeArgs);
static member GetFuncType : Type[] -> Type
Public Shared Function GetFuncType (ParamArray typeArgs As Type()) As Type

參數

typeArgs
Type[]

包含一到十七個 Type 物件的陣列,指定 System.Func 委派類型的類型引數。An array of one to seventeen Type objects that specify the type arguments for the System.Func delegate type.

傳回

Type

System.Func 委派的類型,具有指定的型別引數。The type of a System.Func delegate that has the specified type arguments.

例外狀況

typeArgs 包含少於一個或多過十七個項目。typeArgs contains fewer than one or more than seventeen elements.

typeArgsnulltypeArgs is null.

備註

typeArgs 至少必須包含一個和最多17個元素。typeArgs must contain at least one and at most seventeen elements.

例如,如果的專案代表型別 typeArgs T1…Tn ,則產生的物件會 Type System.Func<T1,…,Tn> 以 c # 或 Visual Basic 中的結構化委派型別表示 System.Func(Of T1,…,Tn)As an example, if the elements of typeArgs represent the types T1…Tn, the resulting Type object represents the constructed delegate type System.Func<T1,…,Tn> in C# or System.Func(Of T1,…,Tn) in Visual Basic.

適用於