private void buttonAccept_Click(object sender, EventArgs e) { using (var tasker = new Tasks.Tasker(this)) { tasker.AttachView(new Tasks.TaskerTaskbar()); tasker.AttachView(new Tasks.TaskerForm()); var task = new Tasks.GameTask(); for (int i = 0; i < listViewGames.Items.Count; ++i) { var gameItem = listViewGames.Items[i]; if (gameItem.SubItems[4].Text != Resources.DefaultNoChange) { var game = gameItem.Tag as NesApplication; foreach (var coverMatch in game.CoverArtMatches) { if (Path.GetFileName(coverMatch) == gameItem.SubItems[4].Text) { task.GamesChanged[game] = coverMatch; break; } } } } tasker.AddTask(task.SetCoverArtForMultipleGames); var conclusion = tasker.Start(); } DialogResult = DialogResult.OK; Close(); }
private void buttonImport_Click(object sender, EventArgs e) { if (listViewGames.SelectedItems.Count > 0) { gameCopied = true; using (var tasker = new Tasks.Tasker(this)) { tasker.AttachView(new TaskerTaskbar()); tasker.AttachView(new TaskerForm()); tasker.SetTitle(Resources.CopyingGames); if (hakchi.Shell.IsOnline) { foreach (var game in SelectedGames) { tasker.AddTask(GameCopyTask(game)); } } tasker.Start(); } } }