private bool?[] Enable = new bool?[20];
I expose the array:
#region Properties
[Description("Prior Year - Enable/Disable (true/false)")]
[Category("Parameters")]
public bool? Prior_Year
{
get { return Enable[0]; }
set { Enable[0] = value; }
}
[Description("52 Week - Enable/Disable (true/false)")]
[Category("Parameters")]
public bool? Trailing_52_Week
{
get { return Enable[1]; }
set { Enable[1] = value; }
}
[Description("Current Year - Enable/Disable (true/false)")]
[Category("Parameters")]
public bool? Current_Year
{
get { return Enable[2]; }
set { Enable[2] = value; }
}
...
While the array has a dimension of [20] the members will be less.
I want the empty members to be null, however I want to set the default values in "properties" to true or false.
I want to do this because I loop through all instances of Enable[] and perform operations while (Enable[x] != null) within this loop, I perform operations if(Enable[x] != false) and I assign a queue for Enable[x] = true.
How can I assign false to each exposed Enable[] and leave the rest as null, or more simply put; how do I set Enable[] default 'false' or user input 'true' within "Properties"?
Comment