async void CheckUpdate() { if (await Github.ShouldUpdate()) { UpdateButton.Enable($"Updates are available for Apollo Studio ({(await Github.LatestRelease()).Name} - {(await Github.LatestDownload()).Size.Bytes().Humanize("#.##")})."); } }
async void CheckUpdate() { if (await Github.ShouldUpdate()) { UpdateButton.Enable(); } }
async void CheckUpdate() { if (await Github.ShouldUpdate()) { while (App.Windows.OfType <MessageWindow>().Where(i => !i.Completed.Task.IsCompleted).FirstOrDefault() is MessageWindow window) { await window.Completed.Task; } Dispatcher.UIThread.Post(async() => { UpdateButton.Enable($"Updates are available for Apollo Studio ({(await Github.LatestRelease()).Name} - {(await Github.LatestDownload()).Size.Bytes().Humanize("#.##")})."); MinHeight = MaxHeight += 30; }, DispatcherPriority.MinValue); } }
async void Loaded(object sender, EventArgs e) { Position = new PixelPoint(Position.X, Math.Max(0, Position.Y)); if (Launchpad.CFWIncompatible == CFWIncompatibleState.Show) { Launchpad.CFWError(this); } if (Program.Args?.Length > 0) { ReadFile(Program.Args[0]); } Program.Args = null; UpdateBlogpost(); UpdateRelease(); if (IsVisible && !openDialog && await Github.ShouldUpdate()) { Window[] windows = Application.Current.Windows.ToArray(); foreach (Window window in windows) { if (window.GetType() != typeof(MessageWindow)) { window.Close(); } } if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { Program.LaunchAdmin = true; } else { UpdateWindow.Create(this); } } }