XamlType.LookupCollectionKind 方法

定義

傳回 XamlCollectionKind 列舉的值,這個值宣告此 XamlType 使用的特定集合型別。

protected:
 virtual System::Xaml::Schema::XamlCollectionKind LookupCollectionKind();
protected virtual System.Xaml.Schema.XamlCollectionKind LookupCollectionKind ();
abstract member LookupCollectionKind : unit -> System.Xaml.Schema.XamlCollectionKind
override this.LookupCollectionKind : unit -> System.Xaml.Schema.XamlCollectionKind
Protected Overridable Function LookupCollectionKind () As XamlCollectionKind

傳回

XamlCollectionKind

XamlCollectionKind 列舉的值。

備註

此方法是由內部私用方法叫用, () 上 XamlType 沒有任何公用 CollectionKindGetCollectionKind API 存在。

預設實作會使用內部 CLR 反映。 若為 UnderlyingType null ,則預設實作可以使用 BaseType ,如果可用則為 。 此行為會間接呼叫 LookupCollectionKind 遞迴來嘗試尋找有效的基底類型;如果不存在有效的基底類型,則會傳 XamlCollectionKind.None 回 。 一般而言,預設實作會嘗試依反映尋找 Add 基礎類型的方法。 如果找到, MethodInfo 方法的 Add 是足夠的資訊,可判斷應該傳回的值 XamlCollectionKind 。 否則,它會傳回 XamlCollectionKind.None

如果您不依賴預設的內部 CLR 反映,並使用中繼資料或其他技術來報告類型的 XAML 類型系統資訊或架構資訊,請覆寫這個方法。

適用於