Example #1
0
 private void AddHandRecordFileButton_Click(object sender, EventArgs e)
 {
     if (HandRecordFileDialog.ShowDialog() == DialogResult.OK)
     {
         PathToHandRecordFileLabel.Text = HandRecordFileDialog.FileName;
         HandsList handsList = new HandsList(HandRecordFileDialog.FileName);
         if (handsList.Count == 0)
         {
             MessageBox.Show("File contains no hand records", "TabScoreStarter", MessageBoxButtons.OK);
         }
         else
         {
             handsList.WriteToDB(Database.ConnectionString(PathToDBLabel.Text));
             AddHandRecordFileButton.Enabled = false;
             AnalysingLabel.Text             = "Analysing...";
             AnalysingLabel.Visible          = true;
             AnalysingProgressBar.Visible    = true;
             AnalysisCalculationBackgroundWorker.RunWorkerAsync();
         }
     }
 }