語言

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, UInt16, UInt32, UInt64

建構函式

名稱 Description
KeyTypeAttribute()

標記成員為 KeyDataViewType。

KeyTypeAttribute(UInt64)

標記成員為 KeyDataViewType 並指定 KeyDataViewType 基數。 若屬性與整數型別一起使用, count 應將 設為比最大值多一的值,以因應計數從 1 開始(0 保留給缺少的 KeyType)。 例如,0-9 範圍的基數為 10。 若值超出指定基數,則會映射到缺失值表示:0。

適用於