void OnLogEvent(AppLog.LogEntry entry) { logGrid.Items.Insert(0, new LogItem(entry)); if (App.GetConfigInt("GUI", "ShowNotifications", 1) == 0) { return; } if ((entry.categoryID & (short)Priv10Logger.EventFlags.Notifications) != 0) { System.Windows.Forms.ToolTipIcon tipIcon = System.Windows.Forms.ToolTipIcon.Info; if (entry.entryType == EventLogEntryType.Error) { tipIcon = System.Windows.Forms.ToolTipIcon.Error; } else if (entry.entryType == EventLogEntryType.Warning) { tipIcon = System.Windows.Forms.ToolTipIcon.Warning; } App.TrayIcon.Notify(entry.strMessage, tipIcon); } // todo: use owne window with a log /*if ((entry.categoryID & (short)App.EventFlags.PopUpMessages) != 0) * { * MessageBoxImage boxIcon = MessageBoxImage.Information; * if (entry.entryType == EventLogEntryType.Error) * boxIcon = MessageBoxImage.Warning; * else if (entry.entryType == EventLogEntryType.Warning) * boxIcon = MessageBoxImage.Error; * MessageBox.Show(entry.strMessage, App.mName, MessageBoxButton.OK, boxIcon); * }*/ }
public LogItem(AppLog.LogEntry args) { this.args = args; }