BeginMonitoring() public method

Begins monitoring the log file for changes.
public BeginMonitoring ( ) : void
return void
コード例 #1
0
ファイル: Main.cs プロジェクト: Flaw/PoEWhisperNotifier
 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();
 }
コード例 #2
0
ファイル: Main.cs プロジェクト: jowilkin/PoEWhisperNotifier
 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() + ".");
 }