コード例 #1
0
 private void LogUserNotificationToConsole(UserNotificationEvent @event)
 {
     if (@event != null)
     {
         _screen.DisplayUserNotification(@event);
     }
 }
コード例 #2
0
ファイル: MainScreen.cs プロジェクト: kbrowns/nplant
        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);
        }
コード例 #3
0
        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());
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: nplant/nplant
        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());
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
 private void LogUserNotificationToConsole(UserNotificationEvent @event)
 {
     if (@event != null)
         _screen.DisplayUserNotification(@event);
 }
コード例 #7
0
 public void DisplayUserNotification(UserNotificationEvent @event)
 {
 }