private void godtoiso_RemoveFinished_btn_Click(object sender, EventArgs e) { try { var itemToRemove = godtoiso_blvex.Items.Where( obj => { GameOnDemand di = (GameOnDemand)obj.Value; if ((di.Status == PackageStatus.Canceled) || (di.Status == PackageStatus.Finished) || (di.Status == PackageStatus.Errored)) { return(true); } return(false); }).ToList(); foreach (var item in itemToRemove) { godtoiso_blvex.Items.Remove(item); } } catch (Exception ex) { Console.Write(ex.ToString()); throw; } }
private void godtoiso_Remove_btn_Click(object sender, EventArgs e) { GameOnDemand god = (GameOnDemand)godtoiso_blvex.SelectedValue; if ((god?.Status == PackageStatus.Canceled) || (god?.Status == PackageStatus.Invalid) || (god?.Status == PackageStatus.Errored)) { _godList.Remove(god); } else { MessageBox.Show("Unable to remove. Status must be 'Waiting'.", "Alert"); } }
private void godtoiso_CreateIso_btn_Click(object sender, EventArgs e) { //XcpInstance xcp = (XcpInstance) xcptogod_blvex.SelectedValue GameOnDemand god = (GameOnDemand)godtoiso_blvex.SelectedValue; if (god == null) { MessageBox.Show("Please Select a Game to Convert", "Alert"); return; } Task.Run(() => { god.CreateIso(BindingStrings.Instance.IsoPath, ConverterOptions.fixcbHeader); }).ContinueWith(prevTask => { if (prevTask.Exception != null) { throw prevTask.Exception; } }); }
private void God_CreateIsoProgress(object sender, ProgressChangedEventArgs e) { GameOnDemand god = (GameOnDemand)sender; _godList.ResetItem(_godList.IndexOf(god)); }