private async void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (!exit) { e.Cancel = true; var exitMessage = $"{FindResource("ExitMessage")}"; bool loadSubPage = false; DownloadPage page = SubscriptionManager.Subscriptions.FirstOrDefault(x => x.StillDownloading())?.GetDownloadPage(); if (page != null) { exitMessage = $"{FindResource("StillDownloadingSubscriptionsExit")}"; loadSubPage = true; } var res = await ShowYesNoDialog((string)FindResource("Exit"), exitMessage); if (res == MessageDialogResult.Affirmative) { if (GlobalConsts.UpdateLater && !GlobalConsts.UpdateFinishedDownloading) { GlobalConsts.LoadPage(GlobalConsts.UpdateControl?.UpdateLaterStillDownloading()); return; } exit = true; page = null; Close(); } else if (loadSubPage) { GlobalConsts.LoadPage(page); } } }
private void BulkDownloadButton_Click(object sender, RoutedEventArgs e) { var links = BulkLinksTextBox.Text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); _ = DownloadPage.SequenceDownload(links, GlobalConsts.DownloadSettings.Clone(), silent: true); BulkLinksTextBox.Text = string.Empty; MetroAnimatedTabControl.SelectedItem = QueueMetroTabItem; }
private void BulkDownloadButton_Click(object sender, RoutedEventArgs e) { var links = BulkLinksTextBox.Text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); if (!CanDownload()) { GlobalConsts.ShowMessage((string)FindResource("Error"), $"{string.Format((string)FindResource("FileDoesNotExist"), GlobalConsts.FFmpegFilePath)}").ConfigureAwait(false); return; } _ = DownloadPage.SequenceDownload(links, GlobalConsts.DownloadSettings.Clone(), silent: true); BulkLinksTextBox.Text = string.Empty; MetroAnimatedTabControl.SelectedItem = QueueMetroTabItem; }