/// <summary> /// Adds a CrashReport object to the collection. /// </summary> /// <param name="report">The CrashReport object to add.</param> public void Add(CrashReport report) { int size = InnerList.Count; if (size >= historyLength) { InnerList.RemoveAt(0); } InnerList.Add(report); }
private void Process_ProcessCrash(object sender, EventArgs e) { CrashReport report = new CrashReport(this.process); reports.Add(report); // Determine the stability of the process and if we should restart it. if (Stable) { Trace.WriteLine("ServerProcessWatchdog has determined that the process is stable, and is attempting to restart it."); process.StartProcess(); } else { Trace.WriteLine("ServerProcessWatchdog has declared the process to be unstable, and will no longer monitor or attempt to start it until manual intervention takes place."); if (ProcessUnstable != null) { ProcessUnstable(this, new EventArgs()); } } }