using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tango.Core { /// /// Represents a parameter item attribute for used for default, min and max values definition of properties. /// /// public class ParameterItemAttribute : Attribute { /// /// Gets or sets the custom parameter name. /// public String Name { get; set; } /// /// Gets or sets the default value. /// public object Default { get; set; } /// /// Gets or sets the minimum value. /// public object Minimum { get; set; } /// /// Gets or sets the maximum value. /// public object Maximum { get; set; } /// /// Gets or sets an optional extra object. /// public object ExtraObject { get; set; } /// /// Gets or sets an optional custom editor type name. /// public String CustomEditorTypeName { get; set; } /// /// Initializes a new instance of the class. /// public ParameterItemAttribute() { Default = null; Minimum = 0.0d; Maximum = 1.0d; } /// /// Initializes a new instance of the class. /// /// The name. /// The minimum value. /// The maximum value. /// The default value. public ParameterItemAttribute(String name, object minimumValue, object maximumValue, object defaultValue) : this() { Name = name; Default = defaultValue; Minimum = minimumValue; Maximum = maximumValue; } /// /// Initializes a new instance of the class. /// /// The name. /// The minimum value. /// The maximum value. public ParameterItemAttribute(String name, object minimumValue, double maximumValue) : this(name, minimumValue, maximumValue, null) { } /// /// Initializes a new instance of the class. /// /// The minimum value. /// The maximum value. public ParameterItemAttribute(object minimumValue, object maximumValue) : this() { Minimum = minimumValue; Maximum = maximumValue; } /// /// Initializes a new instance of the class. /// /// Type of the custom parameter editor type name. public ParameterItemAttribute(String customParameterEditorTypeName) : this() { CustomEditorTypeName = customParameterEditorTypeName; } /// /// Initializes a new instance of the class. /// /// The name. /// Name of the custom parameter editor type. /// The minimum value. /// The maximum value. /// The default value. /// The extra object. public ParameterItemAttribute(String name, String customParameterEditorTypeName, object minimumValue, object maximumValue, object defaultValue, object extraObject) : this() { Name = name; Minimum = minimumValue; Maximum = maximumValue; Default = defaultValue; CustomEditorTypeName = customParameterEditorTypeName; ExtraObject = extraObject; } /// /// Initializes a new instance of the class. /// /// The name. /// Custom parameter editor type. /// The minimum value. /// The maximum value. /// The default value. /// The extra object. public ParameterItemAttribute(String name, Type customParameterEditorType, object minimumValue, object maximumValue, object defaultValue, object extraObject) : this() { Name = name; Minimum = minimumValue; Maximum = maximumValue; Default = defaultValue; CustomEditorTypeName = customParameterEditorType.AssemblyQualifiedName; ExtraObject = extraObject; } } }