EDIT: I did some research on this, but couldn't find a solution!
I am reading the configuration from an XML file. The configuration layout is configured for a specific version. This version is in the first line of XML, which is easy to extract.
What I would like to know is the best way to parse this file / get another version based method (so all 4 elements, major, small, strict and editor).
Right now I came up with this:
switch (version.Major) { case 0: switch (version.Minor) { case 0: switch (version.Build) { case 0: switch (version.Revision) { case 0: return VersionNone(doc); } break; } break; } break; } throw new NotImplementedException();
But I do not find it elegant (in general), and I feel that there is a better way to do this.
Who can help?
Foitn source share