Exemplo n.º 1
0
 void SaveSettings()
 {
     SettingsManager.Options.LogEnable = LoggingCheckBox.Checked;
     LoggingTextBox.Enabled            = !LoggingCheckBox.Checked;
     LoggingPlaySoundCheckBox.Enabled  = !LoggingCheckBox.Checked;
     LoggingFolderTextBox.Enabled      = !LoggingCheckBox.Checked;
     OpenButton.Enabled      = !LoggingCheckBox.Checked;
     FilterTextLabel.Enabled = !LoggingCheckBox.Checked;
     LogFolderLabel.Enabled  = !LoggingCheckBox.Checked;
     lock (WriterLock)
     {
         var en = SettingsManager.Options.LogEnable;
         if (Writer == null && en && !IsDisposed && !Disposing)
         {
             Writer = new ClassLibrary.IO.LogFileWriter();
             Writer.LogFilePrefix    = GetLogsPath(true) + "\\log_";
             Writer.LogFileAutoFlush = true;
         }
         else if (Writer != null && !en)
         {
             Writer.Dispose();
             Writer = null;
         }
     }
 }
Exemplo n.º 2
0
 public override void Dispose()
 {
     base.Dispose();
     lock (WriterLock)
     {
         foreach (var device in CaptureDevices)
         {
             device.Close();
         }
         if (Writer != null)
         {
             Writer.Dispose();
             Writer = null;
         }
     }
 }