예제 #1
0
 public MainViewModel(ICommand ChangeToSettingsView, Configuration Config, string currentVersion)
 {
     Task.Run(async() => await CheckForUpdates.InformLatestRelease(currentVersion));
     this.ChangeToSettingsView = ChangeToSettingsView;
     StartRunCommand           = new RelayCommand(() => StartStopTimer(true));
     CheckGameRunningCommand   = new RelayCommand(CheckGameRunningButton);
     this.Config         = Config;
     ShowVersionNumber   = true;
     VersionNumber       = "Version " + currentVersion;
     ScreenshotImage     = ScreenCapture.ImageSourceFromBitmap(Properties.Resources.background);
     TimerText           = "00:00:00";
     StartStopButtonText = "Start";
     CheckGameRunning();
 }
예제 #2
0
        public void Parse_CurrentVersionIsNewer()
        {
            var results = CheckForUpdates.Parse(new List <ReleaseModel>
            {
                new ReleaseModel
                {
                    Draft      = false,
                    PreRelease = false,
                    TagName    = "v0.1"
                }
            }, "0.2");

            Assert.AreEqual(UpdateStatus.CurrentVersionIsLatest, results.Key);
            Assert.AreEqual("0.1.0", results.Value);
        }
예제 #3
0
        public void Parse_CurrentVersionIsOlder()
        {
            var results = CheckForUpdates.Parse(new List <ReleaseModel>
            {
                new ReleaseModel
                {
                    Draft      = false,
                    PreRelease = false,
                    TagName    = "v0.9"
                }
            }, "0.8");

            Assert.AreEqual(UpdateStatus.NeedToUpdate, results.Key);
            Assert.AreEqual("0.9.0", results.Value);
        }
    public DeploymentCommand Get(string applicationName)
    {
        var fileName = GetFileName(applicationName);
        DeploymentCommand deploymentCommand;

        if (File.Exists(fileName))
        {
            var text = File.ReadAllText(fileName, Encoding.UTF8);
            deploymentCommand = _serializer.Deserialize <DeploymentCommand>(text);
        }
        else
        {
            var now = UniversalTime.Default.Now;
            deploymentCommand = new CheckForUpdates(now);
        }

        return(deploymentCommand);
    }
예제 #5
0
        public Task Update()
        {
            var entryAssembly   = Assembly.GetEntryAssembly();
            var title           = GetTitle(entryAssembly);
            var applicationName = title;

            var repository = new DeploymentCommandRepository(_serializer);

            DeploymentCommand command;

            try
            {
                command = repository.Get(applicationName);
            }
            catch
            {
                var now = UniversalTime.Default.Now;
                command = new CheckForUpdates(now);
            }

            return(Handle((dynamic)command));
        }
예제 #6
0
        public override IEnumerator Leave(Oui next)
        {
            Everest.Loader.AutoLoadNewMods = true;

            Audio.Play(SFX.ui_main_whoosh_large_out);
            menu.Focused = false;
            menuOnScreen = false;

            for (float p = 0f; p < 1f; p += Engine.DeltaTime * 4f)
            {
                menu.X = onScreenX + 1920f * Ease.CubeIn(p);
                alpha  = 1f - Ease.CubeIn(p);
                yield return(null);
            }

            menu.Visible = Visible = false;
            menu.RemoveSelf();
            menu = null;

            currentCheckForUpdates = null;
            updatableMods          = new List <ModUpdateHolder>();

            task = null;
        }
예제 #7
0
 public static void OpenMigrate()
 {
     EditorLayout
     .GetWindow <MigrationWindow>("Entitas Migration - " + CheckForUpdates.GetLocalVersion(), new Vector2(415f, 564))
     .Show();
 }
예제 #8
0
 public static void OpenMigrate()
 {
     EntitasEditorLayout.ShowWindow <MigrationWindow>("Entitas Migration - " + CheckForUpdates.GetLocalVersion());
 }
예제 #9
0
 protected void OnCheckForUpdates() => CheckForUpdates?.Invoke(this, null);
예제 #10
0
 private static void Start(string[] args)
 {
     Initialize(args);
     CheckForUpdates.Update(Version);
     MainMenu.Menu(Version);
 }
예제 #11
0
        /// <summary>
        /// The <see cref="Control.Click"/> event handler
        /// for the <see cref="ToolStripMenuItem"/> <see cref="mnuHelpCheckForUpdates"/>
        /// Checks the web for updates by parsing the version.txt file
        /// from ogamas web site, comparing it with assembly version
        /// of installed file.
        /// </summary>
        /// <param name="sender">Source of the event</param>
        /// <param name="e">An empty <see cref="EventArgs"/></param>
        private void mnuHelpCheckForUpdates_Click(object sender, EventArgs e)
        {
            CheckForUpdates updateDlg = new CheckForUpdates();

            updateDlg.ShowDialog();
        }