public DataTable SearchByValue(DataTable table, ToolStripComboBox cmb, ToolStripTextBox txt) { try { object val = ((ComboBox)cmb.Control).SelectedValue; if (val == null) { return(table); } return(SearchByValue(table, val.ToString(), txt.Text)); } catch (Exception ex) { MessageForm.Show(ex); } return(table); }
private void RefreshObject() { try { switch (lbData.SelectedIndex) { case 0: Show(this.Game.CurrentMove.DataRow.Table); break; case 1: Show(this.Game.Moves.DataTable); break; case 2: Show(this.Game.Notations.NotationData); break; case 3: Show(this.Game.Notations.NotationView); break; case 4: Show(this.Game.Notations.Scoring.ScoringData); break; case 5: Show(this.Game.Notations.Scoring.ScoringView); break; case 6: Show(this.Game.Book.BookMoves.DataTable); break; } } catch (Exception ex) { TestDebugger.Instance.WriteError(ex); MessageForm.Show(ex); } }
void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { try { string filename = e.Argument as string; filepath = filename; pgn = new PgnWrapper(); workEventArgument = e; backgroundWorker.ReportProgress(0); pgn.OnGameLoaded += new PgnWrapper.GameLoaded(pgn_OnGameLoaded); pgn.Open(filename); pgn.Close(); } catch (OutOfMemoryException exm) { MessageForm.Show(exm); } catch (Exception ex) { MessageForm.Show("Invalid PGN file format. Some games or moves are not in valid PGN file format.\n"); } }