Class DataMemberRangeAttribute
- Namespace
- Stride.Core.Annotations
- Assembly
- Stride.Core.dll
Defines range values for a property or field.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public class DataMemberRangeAttribute : Attribute
- Inheritance
-
objectDataMemberRangeAttribute
- Inherited Members
- Extension Methods
Remarks
Constructors
DataMemberRangeAttribute(double, double, double, double, int)
Initializes a new instance of the DataMemberRangeAttribute class.
public DataMemberRangeAttribute(double minimum = NaN, double maximum = NaN, double smallStep = NaN, double largeStep = NaN, int decimalPlaces = -1)
Parameters
minimumdoubleThe minimum value this member accepts.
maximumdoubleThe maximum value this member accepts.
smallStepdoubleThe default step used to go from minimum to maximum.
largeStepdoubleThe 'accelerated' step used to go from minimum to maximum.
decimalPlacesintThe number of digits to show after the decimal point.
Remarks
Parameters left at their default value (NaN, or -1 for decimalPlaces) are undefined.
DataMemberRangeAttribute(double, int)
Initializes a new instance of the DataMemberRangeAttribute class.
[Obsolete("Use named arguments instead: [DataMemberRange(minimum: x, decimalPlaces: y)]. Two positional arguments are ambiguous with (minimum, maximum).")]
public DataMemberRangeAttribute(double min, int decimals)
Parameters
Remarks
The parameter names differ from the other constructor on purpose: named arguments
(minimum:, decimalPlaces:) must bind to the other constructor, not to this one.
Properties
DecimalPlaces
Gets the decimal places.
public int? DecimalPlaces { get; }
Property Value
- int?
The decimal places.
LargeStep
Gets the maximum step.
public double? LargeStep { get; }
Property Value
- double?
The maximum step.
Maximum
Gets the maximum inclusive.
public double? Maximum { get; }
Property Value
- double?
The maximum.
Minimum
Gets the minimum inclusive.
public double? Minimum { get; }
Property Value
- double?
The minimum.
SmallStep
Gets the minimum step.
public double? SmallStep { get; }
Property Value
- double?
The minimum step.