I have a 3rd party struct that is comprised of the following:
[StructLayout(LayoutKind.Sequential, Size=1)]
public struct BigBlueReasonCodes
{
public const int ABC_REASONCODE_DESCRIPTION001 = 1000;
public const int ABC_REASONCODE_DESCRIPTION002 = 1005;
public const int ABC_REASONCODE_DESCRIPTION003 = 1010;
public const int DEF_REASONCODE_DESCRIPTION004 = 2001;
public const int DEF_REASONCODE_DESCRIPTION005 = 2010;
public const int DEF_REASONCODE_DESCRIPTION006 = 2013;
public const int GHI_REASONCODE_DESCRIPTION007 = 3050;
public const int GHI_REASONCODE_DESCRIPTION008 = 3050;
public const int GHI_REASONCODE_DESCRIPTION009 = 3052;
public const string JKL_REASONCODE_DESCRIPTION010 = "XYZ";
public const string GHI_REASONCODE_DESCRIPTION011 = "ST";
static BigblueReasonCodes();
}
I am trying to look up the reason description(the field name) based on the reason code(the value) so my class can do someting like:
string failureReason = GetReasonDescription(reasoncode);
Somethings of mention are some have int values and some have string values. I am only worried about the ones with int values. I also only want the ones that start with GHI_ if possible but not a big deal.