Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OptionAttribute.cs
1using System;
2
4{
8 [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = true)]
9 public class OptionAttribute : Attribute
10 {
11 private readonly int stringId;
12 private readonly string label;
13 private readonly object option;
14
19 public OptionAttribute(object Option)
20 : this(Option, 0, Option.ToString())
21 {
22 }
23
29 public OptionAttribute(object Option, string Label)
30 : this(Option, 0, Label)
31 {
32 }
33
40 public OptionAttribute(object Option, int StringId, string Label)
41 {
42 this.option = Option;
43 this.stringId = StringId;
44 this.label = Label;
45 }
46
50 public object Option => this.option;
51
55 public int StringId => this.stringId;
56
60 public string Label => this.label;
61 }
62}
Defines an option to display when editing the parameter.
OptionAttribute(object Option, int StringId, string Label)
Defines an option to display when editing the parameter.
int StringId
String ID in the namespace of the current class, in the default language defined for the class.
OptionAttribute(object Option, string Label)
Defines an option to display when editing the parameter.
string Label
Default label string, in the default language defined for the class.
OptionAttribute(object Option)
Defines an option to display when editing the parameter.