public bool IsUpdateNeeded() { try { var response = ApiHandle.GetRemoteVersionStr(); if (Version.TryParse(response, out var ver)) { if (ApplicationEnv.Instance.AppVersion.ToString() == ver.ToString()) { return(false); } else { return(true); } } else { return(true); } } catch (Exception) { MessageBoxMgr.Instance.ShowCriticalError(LanguageMgr.Instance.ValueOf("Updater_UpdateErrorMB_Title"), LanguageMgr.Instance.ValueOf("Updater_UpdateErrorMB_Desc")); return(false); } }
public ApplicationEnv() { AppVersion = new Version("1.3.4.5447"); CurrentHardware = GetCoreComponent <Hardware>(); Status = ApplicationStatus.Loading; BootIps(); }
public static Version Parse(string ver) { if (Version.TryParse(ver, out var parsed)) { return(parsed); } else { return(new Version("0.0.0.A")); } }
public static CompareResult Compare(Version v1, Version v2) { CompareResult res; if (v1 > v2) { res = CompareResult.Higher; } else if (v1 == v2) { res = CompareResult.Identity; } else if (v1 < v2) { res = CompareResult.Lower; } else { res = CompareResult.Invalid; } return(res); }