Hi. I am new to enumerations.
I basically want to create specific enumerators and associate them with a string error message.
how do I do this?
I have:
then...Code:public enum ErrorCode : int { EnumName1 = -1; EnumName2 = -2; }
Code:public class ErrorDescriptors { const string EnumName1 = "error 1"; const string EnumName2 = "error 2"; } public string DoGetErrorMessage(ErrorCode errorNumber) { //now I want to take the parameters and associate it with an error message matching the ErrorCode with the ErrorDescriptor class. how? }
As well as this, is it possible to say give the method an INT and then the method would figure out what that value is equal to in the enumerators?





any chance of a regain? 
Reply With Quote