BeginMonitoring() public method

Begins monitoring the log file for changes.
public BeginMonitoring ( ) : void
return void
Exemplo n.º 1
0
 private void Start()
 {
     if(!LogMonitor.IsValidLogPath(txtLogPath.Text)) {
         MessageBox.Show("The log path you have entered is invalid. Please select the client.txt file located in the PoE folder.");
         return;
     }
     cmdStop.Enabled = true;
     cmdStart.Enabled = false;
     this.Monitor = new LogMonitor(txtLogPath.Text);
     Monitor.BeginMonitoring();
     Monitor.MessageReceived += ProcessMessage;
     IdleManager.BeginMonitoring();
 }
Exemplo n.º 2
0
 private void Start(bool AutoStarted)
 {
     if(!LogMonitor.IsValidLogPath(txtLogPath.Text)) {
         string ErrMsg = "Failed to start " + (AutoStarted ? "automatically " : "") + "as the log path is invalid.";
         if (AutoStarted)
             AppendMessage(ErrMsg);
         else
             MessageBox.Show(ErrMsg);
         return;
     }
     cmdStop.Enabled = true;
     cmdStart.Enabled = false;
     this.Monitor = new LogMonitor(txtLogPath.Text);
     Monitor.BeginMonitoring();
     Monitor.MessageReceived += ProcessMessage;
     IdleManager.BeginMonitoring();
     AppendMessage("Program started at " + DateTime.Now.ToShortTimeString() + ".");
 }