private void LogUserNotificationToConsole(UserNotificationEvent @event) { if (@event != null) { _screen.DisplayUserNotification(@event); } }
public void DisplayUserNotification(UserNotificationEvent @event) { this.ConsoleLogText.AppendText(@event.Message); this.ConsoleLogText.SelectionStart = ConsoleLogText.Text.Length; this.ConsoleLogText.ScrollToCaret(); string caption = null; if (@event.NotificationType == UserNotificationType.Warning) caption = "Warning"; else if (@event.NotificationType == UserNotificationType.Error) caption = "Error"; if(caption != null) MessageBox.Show(@event.Message, caption, MessageBoxButtons.OK); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += (sender, args) => { if (args.Exception != null) { var @event = new UserNotificationEvent(args.Exception.Message, UserNotificationType.Error); EventDispatcher.Raise(@event); } }; UnpackPlantUML(); Application.Run(new MainScreen()); }
public void DisplayUserNotification(UserNotificationEvent @event) { this.ConsoleLogText.AppendText(@event.Message); this.ConsoleLogText.SelectionStart = ConsoleLogText.Text.Length; this.ConsoleLogText.ScrollToCaret(); string caption = null; if (@event.NotificationType == UserNotificationType.Warning) { caption = "Warning"; } else if (@event.NotificationType == UserNotificationType.Error) { caption = "Error"; } if (caption != null) { MessageBox.Show(@event.Message, caption, MessageBoxButtons.OK); } }
private void LogUserNotificationToConsole(UserNotificationEvent @event) { if (@event != null) _screen.DisplayUserNotification(@event); }
public void DisplayUserNotification(UserNotificationEvent @event) { }