コード例 #1
0
ファイル: PopupHelper.cs プロジェクト: BelievingHeart/ALC-004
        public static PopupViewModel CreateSafeDoorPopup(string message, AlcServerViewModel alcServer)
        {
            // TODO: define continue and quit message pack
            PlcMessagePack continueMessagePack = null;
            PlcMessagePack quitMessagePack     = null;

            var content = "请关门后点击继续,或者点取消退出自动模式";

            return(new PopupViewModel()
            {
                OkButtonText = "继续",
                CancelButtonText = "取消",
                OkCommand = new CloseDialogAttachedCommand(o => true, () =>
                {
                    alcServer.SentToPlc(continueMessagePack, PlcMessageType.Request);
                }),
                CancelCommand = new CloseDialogAttachedCommand(o => true, () =>
                {
                    alcServer.SentToPlc(quitMessagePack, PlcMessageType.Request);
                    alcServer.IsAutoRunning = false;
                }),
                MessageItem = LoggingMessageItem.CreateMessage(message),
                Content = content,
                IsSpecialPopup = true
            });
        }
コード例 #2
0
ファイル: PopupHelper.cs プロジェクト: BelievingHeart/ALC-004
        public static PopupViewModel CreateClearProductPopup(string message, long errorCode, AlcServerViewModel alcServer)
        {
            // TODO: define continue and quit message pack
            PlcMessagePack continueMessagePack = null;
            PlcMessagePack quitMessagePack     = null;

            var content = errorCode == 2088? "请清除所有产品后点继续,或者点退出取消自动模式" : "请清料后点击继续,或者点退出再清料";

            return(new PopupViewModel()
            {
                OkButtonText = "继续",
                CancelButtonText = "退出",
                OkCommand = new CloseDialogAttachedCommand(o => true, () =>
                {
                    alcServer.SentToPlc(continueMessagePack, PlcMessageType.Request);
                }),
                CancelCommand = new CloseDialogAttachedCommand(o => true, () =>
                {
                    alcServer.SentToPlc(quitMessagePack, PlcMessageType.Request);
                    alcServer.IsAutoRunning = false;
                }),
                MessageItem = LoggingMessageItem.CreateMessage(message),
                Content = content,
                IsSpecialPopup = true
            });
        }
コード例 #3
0
 private void ScrollToBottom(LoggingMessageItem loggingMessageItem)
 {
     if (MessageList.Count == 0)
     {
         return;
     }
     // Scroll to the last item
     PART_MessageListBox.SelectedIndex = MessageList.Count - 1;
     PART_MessageListBox.ScrollIntoView(PART_MessageListBox.SelectedItem);
 }
コード例 #4
0
ファイル: PopupHelper.cs プロジェクト: BelievingHeart/ALC-004
 public static PopupViewModel CreateNormalPopup(string message)
 {
     return(new PopupViewModel()
     {
         OkButtonText = "确定",
         CancelButtonText = "取消",
         OkCommand = new CloseDialogAttachedCommand(o => true, () => {}),
         CancelCommand = new CloseDialogAttachedCommand(o => true, () => {}),
         MessageItem = LoggingMessageItem.CreateMessage(message),
         IsSpecialPopup = false
     });
 }
コード例 #5
0
        private void CloseMainWindow(object sender, RoutedEventArgs e)
        {
            var popup = new PopupViewModel
            {
                OkCommand        = new CloseDialogAttachedCommand(o => true, Close),
                CancelCommand    = new CloseDialogAttachedCommand(o => true, () => {}),
                OkButtonText     = "确定",
                CancelButtonText = "取消",
                IsSpecialPopup   = true,
                MessageItem      = LoggingMessageItem.CreateMessage("是否退出ALC?")
            };

            Logger.EnqueuePopup(popup);
        }
コード例 #6
0
 private void AddMessageItemView(LoggingMessageItem messageItem)
 {
     PART_MessageListBox.Items.Add(messageItem);
 }