예제 #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 ApplicationEnv()
        {
            AppVersion      = new Version("1.3.4.5447");
            CurrentHardware = GetCoreComponent <Hardware>();
            Status          = ApplicationStatus.Loading;

            BootIps();
        }
예제 #3
0
 public static Version Parse(string ver)
 {
     if (Version.TryParse(ver, out var parsed))
     {
         return(parsed);
     }
     else
     {
         return(new Version("0.0.0.A"));
     }
 }
예제 #4
0
        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);
        }