Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
StepRangeAttribute.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 namespace SiliconStudio.Assets
6 {
7  /// <summary>
8  /// This attribute allows to define boundaries for a numeric property, and advice small and large increment values for the user interface.
9  /// </summary>
10  [AttributeUsage(AttributeTargets.Property)]
11  public class StepRangeAttribute : Attribute
12  {
13  /// <summary>
14  /// Initializes a new instance of the <see cref="StepRangeAttribute"/> using <see cref="double"/> values.
15  /// </summary>
16  /// <param name="minimum">The minimum accepted value for the associated property.</param>
17  /// <param name="maximum">The maximum accepted value for the associated property.</param>
18  public StepRangeAttribute(double minimum, double maximum)
19  {
20  Minimum = minimum;
21  Maximum = maximum;
22  }
23 
24  /// <summary>
25  /// Initializes a new instance of the <see cref="StepRangeAttribute"/> using <see cref="double"/> values.
26  /// </summary>
27  /// <param name="minimum">The minimum accepted value for the associated property.</param>
28  /// <param name="maximum">The maximum accepted value for the associated property.</param>
29  /// <param name="smallStep">The adviced increment value in case of a small change for the associated property.</param>
30  /// <param name="largeStep">The adviced increment value in case of a large change for the associated property.</param>
31  public StepRangeAttribute(double minimum, double maximum, double smallStep, double largeStep)
32  {
33  Minimum = minimum;
34  Maximum = maximum;
35  SmallStep = smallStep;
36  LargeStep = largeStep;
37  }
38 
39  /// <summary>
40  /// Gets or sets the minimum accepted value for the associated property.
41  /// </summary>
42  public object Minimum { get; set; }
43 
44  /// <summary>
45  /// Gets or sets the maximum accepted value for the associated property.
46  /// </summary>
47  public object Maximum { get; set; }
48 
49  /// <summary>
50  /// Gets or sets the adviced increment value in case of a small change for the associated property.
51  /// </summary>
52  public object SmallStep { get; set; }
53 
54  /// <summary>
55  /// Gets or sets the adviced increment value in case of a large change for the associated property.
56  /// </summary>
57  public object LargeStep { get; set; }
58  }
59 }
StepRangeAttribute(double minimum, double maximum)
Initializes a new instance of the StepRangeAttribute using double values.
StepRangeAttribute(double minimum, double maximum, double smallStep, double largeStep)
Initializes a new instance of the StepRangeAttribute using double values.
This attribute allows to define boundaries for a numeric property, and advice small and large increme...