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。

适用于