private void logEntryList_NewEntry(object sender, LogEntryList.ViewEntryEventArgs e) { DataLogOutput.LogEntry logEntry = e.Entry.LogEntry; bool isHidden = this.DockHandler.DockState.IsAutoHide() && !this.ContainsFocus; bool unseenChanges = false; if (isHidden) { if (logEntry.Type == LogMessageType.Warning) { this.unseenWarnings++; unseenChanges = true; } else if (logEntry.Type == LogMessageType.Error) { if (this.unseenErrors == 0) { System.Media.SystemSounds.Hand.Play(); } this.unseenErrors++; unseenChanges = true; } } if (unseenChanges) { this.UpdateTabText(); } }
private void logEntryList_LogEntriesAdded(object sender, LogEntryList.ViewEntryEventArgs e) { bool isHidden = this.DockHandler.DockState.IsAutoHide() && !this.ContainsFocus; bool unseenChanges = false; bool containsError = false; for (int i = 0; i < e.ViewEntries.Count; i++) { EditorLogEntry logEntry = e.ViewEntries[i].LogEntry; LogMessageType type = logEntry.Content.Type; if (isHidden) { if (type == LogMessageType.Warning) { this.unseenWarnings++; unseenChanges = true; } else if (type == LogMessageType.Error) { if (this.unseenErrors == 0) { System.Media.SystemSounds.Hand.Play(); } this.unseenErrors++; unseenChanges = true; } } if (type == LogMessageType.Error) { containsError = true; } this.AddSourceFilterButton(logEntry.Source); } if (unseenChanges) { this.UpdateTabText(); } bool pause = containsError && this.buttonPauseOnError.Checked && Sandbox.State == SandboxState.Playing && !Sandbox.IsChangingState; if (pause) { System.Media.SystemSounds.Hand.Play(); Sandbox.Pause(); } }
private void logEntryList_NewEntry(object sender, LogEntryList.ViewEntryEventArgs e) { LogEntry logEntry = e.Entry.LogEntry; bool isHidden = this.DockHandler.DockState.IsAutoHide() && !this.ContainsFocus; bool unseenChanges = false; if (isHidden) { if (logEntry.Type == LogMessageType.Warning) { this.unseenWarnings++; unseenChanges = true; } else if (logEntry.Type == LogMessageType.Error) { if (this.unseenErrors == 0) { System.Media.SystemSounds.Hand.Play(); } this.unseenErrors++; unseenChanges = true; } } if (unseenChanges) { this.UpdateTabText(); } bool pause = e.Entry.LogEntry.Type == LogMessageType.Error && this.buttonPauseOnError.Checked && Sandbox.State == SandboxState.Playing && !Sandbox.IsChangingState; if (pause) { System.Media.SystemSounds.Hand.Play(); Sandbox.Pause(); } }