So I want to have a property getter that returns an enum value based on an enum value of a different type without having to resort to a long switch statement. Is there a way to match up the two enum lists using an index or values?
public enum LanguageName
{
Arabic,
Chinese,
Dutch,
English,
Farsi,
French,
Hindi,
Indonesian,
Portuguese,
Spanish,
Urdu
}
public enum LanguageISOCode
{
ara,
zho,
dut,
eng,
fas,
fre,
hin,
ind,
por,
spa,
urd
}
public class language
{
public language()
{
}
public LanguageName Name
{
get
{
// get the Name enum based on the Code enum
}
set;
}
public LanguageISOCode Code
{
get;
set;
}
}