Exemplo n.º 1
0
 /// <summary>
 /// toolStripMenuItemStopLogging Click event to stop logging and close file
 /// </summary>
 private void toolStripMenuItemStopLogging_Click(object sender, EventArgs e)
 {
     if (csvFileWriter != null)
     {
         csvFileWriter.CloseFile();
         csvFileWriter = null;
     }
     toolStripMenuItemStartLogging.Enabled = true;
     toolStripMenuItemStopLogging.Enabled = false;
 }
Exemplo n.º 2
0
 /// <summary>
 /// toolStripMenuItemStartLogging Click event to select file location and start logging
 /// </summary>
 private void toolStripMenuItemStartLogging_Click(object sender, EventArgs e)
 {
     SaveFileDialog saveFileDialog = new SaveFileDialog();
     saveFileDialog.Title = "Select File Location";
     saveFileDialog.Filter = "CSV files (*.csv)|*.csv";
     saveFileDialog.OverwritePrompt = false;
     saveFileDialog.FileName = "LoggedData";
     if (saveFileDialog.ShowDialog() == DialogResult.OK)
     {
         csvFileWriter = new CsvFileWriter(saveFileDialog.FileName.ToString());
         toolStripMenuItemStartLogging.Enabled = false;
         toolStripMenuItemStopLogging.Enabled = true;
     }
 }