I am holding structured read only data in enum type, now I would like to extend structure and for every value in enum add additional fields. So, my original enum is:
public enum OutputFormats { Pdf, Jpg, Png, Tiff, Ps };
and I want to extend them like so:
Value=Pdf
FileName="*.PDF"
ID=1
Value=Jpg
FileName="*.jpg"
ID=2
…and so on.
An enum can’t hold a multidimensional data structure, so what is generally considered the best “place” to hold such structured data? Should I create a class with value, filename, and id properties and initialize the data in the class constructor?
Perhaps this pseudo-enum pattern will be useful:
Another variation, perhaps more concise: