aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core/ParameterItemAttribute.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-11-16 13:38:56 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-11-16 13:38:56 +0200
commit914f4db513477d9aff726546bac47545195a3e37 (patch)
treed2ff190fd84b1dfaa03eec76563c431592ece7ff /Software/Visual_Studio/Tango.Core/ParameterItemAttribute.cs
parent65d01ff549d80fbe13ff5e966df216c9f7c03653 (diff)
downloadTango-914f4db513477d9aff726546bac47545195a3e37.tar.gz
Tango-914f4db513477d9aff726546bac47545195a3e37.zip
Rename "Visual Studio" to "Visual_Studio"
Rename "External Repositories" to "External_Repositories".
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/ParameterItemAttribute.cs')
-rw-r--r--Software/Visual_Studio/Tango.Core/ParameterItemAttribute.cs140
1 files changed, 140 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Core/ParameterItemAttribute.cs b/Software/Visual_Studio/Tango.Core/ParameterItemAttribute.cs
new file mode 100644
index 000000000..68405fe64
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/ParameterItemAttribute.cs
@@ -0,0 +1,140 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Core
+{
+ /// <summary>
+ /// Represents a parameter item attribute for used for default, min and max values definition of properties.
+ /// </summary>
+ /// <seealso cref="System.Attribute" />
+ public class ParameterItemAttribute : Attribute
+ {
+ /// <summary>
+ /// Gets or sets the custom parameter name.
+ /// </summary>
+ public String Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the default value.
+ /// </summary>
+ public object Default { get; set; }
+
+ /// <summary>
+ /// Gets or sets the minimum value.
+ /// </summary>
+ public object Minimum { get; set; }
+
+ /// <summary>
+ /// Gets or sets the maximum value.
+ /// </summary>
+ public object Maximum { get; set; }
+
+ /// <summary>
+ /// Gets or sets an optional extra object.
+ /// </summary>
+ public object ExtraObject { get; set; }
+
+ /// <summary>
+ /// Gets or sets an optional custom editor type name.
+ /// </summary>
+ public String CustomEditorTypeName { get; set; }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
+ /// </summary>
+ public ParameterItemAttribute()
+ {
+ Default = null;
+ Minimum = 0.0d;
+ Maximum = 1.0d;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <param name="minimumValue">The minimum value.</param>
+ /// <param name="maximumValue">The maximum value.</param>
+ /// <param name="defaultValue">The default value.</param>
+ public ParameterItemAttribute(String name, object minimumValue, object maximumValue, object defaultValue) : this()
+ {
+ Name = name;
+ Default = defaultValue;
+ Minimum = minimumValue;
+ Maximum = maximumValue;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <param name="minimumValue">The minimum value.</param>
+ /// <param name="maximumValue">The maximum value.</param>
+ public ParameterItemAttribute(String name, object minimumValue, double maximumValue) : this(name, minimumValue, maximumValue, null)
+ {
+
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
+ /// </summary>
+ /// <param name="minimumValue">The minimum value.</param>
+ /// <param name="maximumValue">The maximum value.</param>
+ public ParameterItemAttribute(object minimumValue, object maximumValue) : this()
+ {
+ Minimum = minimumValue;
+ Maximum = maximumValue;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
+ /// </summary>
+ /// <param name="customParameterEditorTypeName">Type of the custom parameter editor type name.</param>
+ public ParameterItemAttribute(String customParameterEditorTypeName) : this()
+ {
+ CustomEditorTypeName = customParameterEditorTypeName;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <param name="customParameterEditorTypeName">Name of the custom parameter editor type.</param>
+ /// <param name="minimumValue">The minimum value.</param>
+ /// <param name="maximumValue">The maximum value.</param>
+ /// <param name="defaultValue">The default value.</param>
+ /// <param name="extraObject">The extra object.</param>
+ 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;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <param name="customParameterEditorTypeName">Custom parameter editor type.</param>
+ /// <param name="minimumValue">The minimum value.</param>
+ /// <param name="maximumValue">The maximum value.</param>
+ /// <param name="defaultValue">The default value.</param>
+ /// <param name="extraObject">The extra object.</param>
+ 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;
+ }
+ }
+}