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(); }
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() + "."); }