语言

NumericAttribute 类

定义

为数值字段或属性中可能的值提供限制。

[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)]
[System.Serializable]
public class NumericAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)>]
[<System.Serializable>]
type NumericAttribute = class
    inherit Attribute
Public Class NumericAttribute
Inherits Attribute
继承
NumericAttribute
属性

注解

默认情况下,限制是底层字段类型的最小值和最大值。

构造函数

名称 说明
NumericAttribute(Double, Double)

指定数字字段的可能值范围。

字段

名称 说明
Max

最大可能价值。

Min

最小可能值。

适用于