static string ToString(Dnr2035Version v) { switch (v) { case Dnr2035Version.V20: return("2.0"); case Dnr2035Version.V30: return("3.0"); case Dnr2035Version.V35: return("3.5"); default: throw new InvalidOperationException(); } }
// If input module is V35, use it, else check all its assembly references for version and // use highest version found. It doesn't try to check the asm refs of the asm refs, this // should be enough. static string GetDotNetVersion2035(ModuleDef module) { Dnr2035Version ver = Dnr2035Version.V20; foreach (var m in GetModules(module)) { ver = Max(ver, GetDotNetVersion2035Internal(m)); if (ver == Dnr2035Version.V35) { return(ToString(ver)); } } return(ToString(ver)); }
static Dnr2035Version Max(Dnr2035Version a, Dnr2035Version b) => a > b ? a : b;
static string ToString(Dnr2035Version v) { switch (v) { case Dnr2035Version.V20: return "v2.0"; case Dnr2035Version.V30: return "v3.0"; case Dnr2035Version.V35: return "v3.5"; default: throw new InvalidOperationException(); } }
static Dnr2035Version Max(Dnr2035Version a, Dnr2035Version b) { return a > b ? a : b; }
static Dnr2035Version Max(Dnr2035Version a, Dnr2035Version b) { return(a > b ? a : b); }