Table of Contents

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
object
DataMemberRangeAttribute
Inherited Members
Extension Methods

Remarks

Minimum, Maximum and SmallStep must have the same type

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

minimum double

The minimum value this member accepts.

maximum double

The maximum value this member accepts.

smallStep double

The default step used to go from minimum to maximum.

largeStep double

The 'accelerated' step used to go from minimum to maximum.

decimalPlaces int

The 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

min double

The minimum.

decimals int

The decimal places

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.