EDIT: I've done some research about this, but have not been able to find a solution!
I'm reading a configuration from an XML file. The layout of the configuration is set for certain version. This version is in the first line of the XML, which is easy to extract.
What I would like to know is, what is the best way to actually parse this file/get another method, based on the version (so all 4 elements, the Major, Minor, Build and Revision).
Right now I've come 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 this elegant (at all) and I feel like there is a way better way to do this.
Anyone who can help?