private void AddWindow_TitleAdded(TaskDownloadTitle task) { Focus(); downloadTasks.Add(task); TitleDownloader.AddTaskToDownload(task); ListView.Items.Add(new { task.Title.NameRu, task.Progress.ProgrssInPersent }); }
private void Title_DownloadProgressChanged(TaskDownloadTitle task) { Dispatcher.Invoke(() => { int row = task.IndexNumber; ListView.Items[row] = new { task.Title.NameRu, ProgrssInPersent = task.Progress.ProgrssInPersent }; }); }
private void Title_DownloadProgressChanged(TaskDownloadTitle task) { Invoke(new Action(() => { int row = task.IndexNumber; dataGridView.Rows[row].Cells[1].Value = $"{task.Progress.ProgrssInPersent}%"; })); }
private void Title_Downloaded(TaskDownloadTitle task) { Invoke(new Action(() => { int row = task.IndexNumber; dataGridView.Rows[row].Cells[1].Value = "Complete"; })); }
private static void TitleDownloader_Downloaded(TaskDownloadTitle task) { Console.ForegroundColor = ConsoleColor.Green; Console.CursorTop = progressTop; Console.CursorLeft = 0; Console.Write($"{task.Title.NameRu} downloaded at 100%"); Console.ResetColor(); Environment.Exit(0); }
private void AddForm_TitleAdded(TaskDownloadTitle task) { Focus(); downloadTasks.Add(task); TitleDownloader.AddTaskToDownload(task); dataGridView.Rows.Add(); dataGridView.Rows[task.IndexNumber].Cells[0].Value = task.Title.NameRu; dataGridView.Rows[task.IndexNumber].Cells[1].Value = ""; }
private void Add_button_Click(object sender, EventArgs e) { if (title != null) { var checkedIndexes = chapterList_checkedListBox.CheckedIndices; List <int> ChapterNumberForDownload = new List <int>(); foreach (int indexChecked in checkedIndexes) { ChapterNumberForDownload.Add(indexChecked + 1); } string pathToDownload = PathToDownload_textBox.Text; TaskDownloadTitle downloadTask = new TaskDownloadTitle(title, ChapterNumberForDownload, pathToDownload); Close(); TitleAdded?.Invoke(downloadTask); } }
private void Add_Click(object sender, RoutedEventArgs e) { if (title != null) { List <int> ChapterNumberForDownload = new List <int>(); for (int i = 0; i < ChapterListBox.Items.Count; i++) { var checkBox = ((CheckBox)ChapterListBox.Items[i]); if (checkBox.IsChecked.Value) { ChapterNumberForDownload.Add(i + 1); } } TaskDownloadTitle downloadTask = new TaskDownloadTitle(title, ChapterNumberForDownload, @"C:\Users\Vasiliy\Documents\Manga"); Close(); TitleAdded?.Invoke(downloadTask); } }
private static void TitleDownloader_DownloadProgresChanged(TaskDownloadTitle task) { Console.CursorTop = progressTop; Console.CursorLeft = 0; Console.Write($"{task.Title.NameRu} downloaded at {task.Progress.ProgrssInPersent}%"); }