H
henry.lee.jr
I thought I had a nice idea here:
private enum ProcessStatus : int
{
Initiated = Properties.Settings.Default.Status_Initiated,
Running = Properties.Settings.Default.Status_Running,
Complete = Properties.Settings.Default.Status_Complete,
Failed = Properties.Settings.Default.Status_Failed
}
This was great because I could define status codes in my settings file
(and later change them if needed on the fly without a code recompile
or going at a database table all the time) like so:
private void UpdateProcessStatus(ActionStatus status, string
information)
Problem is that the compiler does not like it ...
The property or indexer '[xxx].Properties.Settings.Default' cannot be
used in this context because it lacks the get accessor'
I'm not sure why a property would lack a get accessor, somewhat
defeats the purpose of a property. I'm also using properties.settings
in other points of my code to define stored procedure names without
issue. The only thing I can think of is that the enum is defined
before runtime, and these property defaults can only be accessed
during run time?
If so, does anyone have a nice clean way I can create enum values that
can be set with settings, or do I need to create variables for each
status type and then populate them at run time all the time?
Thanks
private enum ProcessStatus : int
{
Initiated = Properties.Settings.Default.Status_Initiated,
Running = Properties.Settings.Default.Status_Running,
Complete = Properties.Settings.Default.Status_Complete,
Failed = Properties.Settings.Default.Status_Failed
}
This was great because I could define status codes in my settings file
(and later change them if needed on the fly without a code recompile
or going at a database table all the time) like so:
private void UpdateProcessStatus(ActionStatus status, string
information)
Problem is that the compiler does not like it ...
The property or indexer '[xxx].Properties.Settings.Default' cannot be
used in this context because it lacks the get accessor'
I'm not sure why a property would lack a get accessor, somewhat
defeats the purpose of a property. I'm also using properties.settings
in other points of my code to define stored procedure names without
issue. The only thing I can think of is that the enum is defined
before runtime, and these property defaults can only be accessed
during run time?
If so, does anyone have a nice clean way I can create enum values that
can be set with settings, or do I need to create variables for each
status type and then populate them at run time all the time?
Thanks