private void OpenFileButton_Click(object sender, EventArgs e)
 {
     if (FileRadioButton.Checked)
     {
         if (OpenLogFileDialog.ShowDialog(this) == DialogResult.OK)
         {
             LogFileTextBox.Text = OpenLogFileDialog.FileName;
         }
     }
     else
     {
         if (LogFolderBrowserDialog.ShowDialog(this) == DialogResult.OK)
         {
             LogFileTextBox.Text = LogFolderBrowserDialog.SelectedPath;
         }
     }
 }
Esempio n. 2
0
 private void OpenLogFileButton_Click(object sender, EventArgs e)
 {
     if (OpenLogFileDialog.ShowDialog() == DialogResult.OK)
     {
         try
         {
             //open file and start reader thread
             _reader.LogFilePath = OpenLogFileDialog.FileName;
             WriteStatus($"Opened log file {_reader.LogFilePath}.");
             this.Text = _reader.LogFilePath;
             if (!_readLogThread.IsAlive)
             {
                 _readLogThread.Start();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show($"Error opening file: {ex.ToString()}", "Error");
         }
     }
 }