共用方式為


FSharpType.GetUnionCases 方法 (F#)

取得等位型別的案例。

**命名空間/模組路徑:**Microsoft.FSharp.Reflection

組件:FSharp.Core (在 FSharp.Core.dll 中)

// Signature:
static member GetUnionCases : Type * ?BindingFlags -> UnionCaseInfo []

// Usage:
FSharpType.GetUnionCases (unionType)
FSharpType.GetUnionCases (unionType, bindingFlags = bindingFlags)

參數

  • unionType
    型別:Type

    輸入等位型別。

  • bindingFlags
    型別:BindingFlags

    選擇性的繫結旗標。

例外狀況

例外狀況

條件

ArgumentException

當輸入型別不是等位型別時擲回。

傳回值

指定等位型別之案例 (UnionCaseInfo物件) 的描述陣列。

平台

Windows 8 中, Windows 7, Windows Server 2012 上, Windows Server 2008 R2

版本資訊

F# 核心程式庫版本

支援版本:2.0, 4.0,可攜式執行檔 (PE)。

請參閱

參考

Reflection.FSharpType 類別 (F#)

Microsoft.FSharp.Reflection 命名空間 (F#)