KeyTypeAttribute 類別

定義

允許成員標示為 KeyDataViewType

[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public sealed class KeyTypeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type KeyTypeAttribute = class
    inherit Attribute
Public NotInheritable Class KeyTypeAttribute
Inherits Attribute
繼承
KeyTypeAttribute
屬性

備註

只能套用下列類型的成員: Byte 、、 UInt16UInt32UInt64

建構函式

KeyTypeAttribute()

將成員標示為 KeyDataViewType

KeyTypeAttribute(UInt64)

將成員標示為 KeyDataViewType ,並指定 KeyDataViewType 基數。 如果是與 int 類型搭配使用的屬性, count 應該設定為一個以上的最大值,以考慮從 1 開始的計數, (0 會保留給遺漏的 KeyType) 。 例如 0-9 範圍的基數是 10。 如果值不在指定的基數之外,則會對應至遺漏的值標記法:0。

適用於