Now:
2 classes each with the same constant name, e.g. ERR123
class1 got public const int ERR123 = 123;
class2 got public const string ERR123 = "Error 123, something went wrong.";
So I call it like
int code = class1.ERR123;
string message = class2.ERR123;
I don't like this approach because I need to copy the constant names and touch 2 files when I add/change something.
I'd like to access it like that:
int code = Errors.Subcategory1.ERR123.Code;
string message = Errors.Subcategory1.ERR123.Message;
and the declaration shouldn't be that inconvenient. Is this possible? Maybe using some reflection-magic?