コード例 #1
0
ファイル: UpdateCheckTest.cs プロジェクト: Kozu-vr/VitDeck
        public void TestGetLatestVersion()
        {
            var version = UpdateCheck.GetLatestVersion();

            if (version != null)
            {
                Assert.That(version, Is.Not.Empty);
            }
        }
コード例 #2
0
ファイル: InfoWindow.cs プロジェクト: Kozu-vr/VitDeck
 private void Init()
 {
     versionLabel       = "Version : " + ProductInfoUtility.GetVersion();
     developerLinkTitle = ProductInfoUtility.GetDeveloperLinkTitle();
     developerLinkURL   = ProductInfoUtility.GetDeveloperLinkURL();
     if (UpdateCheck.Enabled)
     {
         var version = UpdateCheck.GetLatestVersion();
         if (version == null)
         {
             latestVersion = "None";
         }
         else
         {
             latestVersion = version;
         }
         latestVersionLabel = "Latest Version : " + latestVersion;
     }
 }
コード例 #3
0
        protected override void Logic(ValidationTarget target)
        {
            if (!UpdateCheck.Enabled)
            {
                this.AddIssue(new Issue(
                                  target: null,
                                  IssueLevel.Warning,
                                  "VitDeckのバージョンチェックが無効になっています。",
                                  this.solution,
                                  this.solutionURL
                                  ));
                return;
            }

            var latestVersion = UpdateCheck.GetLatestVersion();

            if (latestVersion == null)
            {
                this.AddIssue(new Issue(
                                  target: null,
                                  IssueLevel.Warning,
                                  "VitDeckの最新バージョン番号の取得に失敗しました。",
                                  this.solution,
                                  this.solutionURL
                                  ));
                return;
            }

            var currentVersion = ProductInfoUtility.GetVersion();

            if (currentVersion != latestVersion)
            {
                this.AddIssue(new Issue(
                                  target: null,
                                  IssueLevel.Error,
                                  $"VitDeckが最新バージョンではありません。\n現在のバージョン: {currentVersion}\n最新バージョン: {latestVersion}",
                                  this.solution,
                                  this.solutionURL
                                  ));
            }
        }