Пример #1
0
        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);
            }
        }
Пример #2
0
 public static Version Parse(string ver)
 {
     if (Version.TryParse(ver, out var parsed))
     {
         return(parsed);
     }
     else
     {
         return(new Version("0.0.0.A"));
     }
 }