コード例 #1
0
        public void OnSaveAsChallengeButtonClick()
        {
            string filename = this.TextInput.FindChildGameObject("UIMessageBoxTextInputText").GetComponent <Text>().text;
            string fullname = filename + ".json";
            string fullpath = Directories.CHALLENGE_FOLDER_FULL_PATH + "/" + fullname;

            MostRecentButtonType = MessageBoxButtonType.Neutral;

            // If file has invalid name, show error dialog
            if (filename.IndexOfAny(Path.GetInvalidFileNameChars()) != -1 ||
                String.IsNullOrWhiteSpace(filename))
            {
                MessageBoxFactory.MakeFromConfig(SaveBadNameMessageBoxConfig, this);
                return;
            }

            // If file already exists, ask for overwrite confirmation
            if (File.Exists(fullpath))
            {
                MessageBoxFactory.MakeFromConfig(SaveOverwriteMessageBoxConfig, this);
                return;
            }

            // Run callback to save circuit, close message box, and unfreeze canvas
            MessageBoxTriggerData triggerData = new MessageBoxTriggerData
            {
                ButtonPressed = MessageBoxButtonType.Neutral,
                Sender        = this,
                TextInput     = filename
            };

            TriggerTarget.Trigger(triggerData);
        }
コード例 #2
0
        public MessageBoxButton(MessageBoxButtonType type, string text)
        {
            button = new YnEntity("Misc/button");
            Add(button);

            label       = new YnText("Font/kozuka_20", text);
            label.Color = Color.White;
            Add(label);
        }
コード例 #3
0
        public static DialogResultEx Show(String messageText, MessageBoxButtonType messageBoxButtons)
        {
            MessageBoxEX messageBoxEx = new MessageBoxEX();

            messageBoxEx.MessageBoxButtons = messageBoxButtons;
            messageBoxEx.MessageText       = messageText;
            messageBoxEx.ShowDialog();
            return(messageBoxEx.DialogResult);
        }
コード例 #4
0
        public MessageWindow(string text, string caption, MessageBoxButtonType buttons)
        {
            this.InitializeComponent();

            this.LabTitle.Content = (((caption != null) && (caption != string.Empty)) && (caption != "")) ? caption : "提示";
            this.LabTips.Text     = text;
            if (buttons == MessageBoxButtonType.OK)
            {
                vbutton2.Visibility = Visibility.Collapsed;
            }
        }
コード例 #5
0
        public void Add(MessageBoxButtonType buttonType)
        {
            GameObject NewButton = Instantiate(Template) as GameObject;

            NewButton.SetActive(true);

            MessageBoxButton data = NewButton.GetComponent <MessageBoxButton>();

            data.Parent = Parent;
            data.Type   = buttonType;
            data.SetText();

            NewButton.transform.SetParent(Container);
            NewButton.transform.localScale = new Vector3(1, 1, 1);
            Objects.Add(NewButton);
        }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PopupWindow"/> class.
        /// </summary>
        /// <param name="content">消息内容.</param>
        /// <param name="messageImageType">图片类型.</param>
        /// <param name="messageBoxButtonType">按钮类型.</param>
        public PopupWindow(string content, MessageImageType messageImageType, MessageBoxButtonType messageBoxButtonType)
            : this()
        {
            Message              = content;
            MessageImageType     = messageImageType;
            MessageBoxButtonType = messageBoxButtonType;

            switch (MessageImageType)
            {
            case MessageImageType.Error:
                ImageSource = new Uri("pack://application:,,,/BPiaoBao.Client.UIExt;component/Image/error.png");
                break;

            case MessageImageType.Warning:
                ImageSource = new Uri("pack://application:,,,/BPiaoBao.Client.UIExt;component/Image/warning.png");
                break;

            case MessageImageType.Question:
                ImageSource = new Uri("pack://application:,,,/BPiaoBao.Client.UIExt;component/Image/question.png");
                break;

            case MessageImageType.Success:
                ImageSource = new Uri("pack://application:,,,/BPiaoBao.Client.UIExt;component/Image/success.png");
                break;

            case MessageImageType.Info:
                ImageSource = new Uri("pack://application:,,,/BPiaoBao.Client.UIExt;component/Image/info.png");
                break;

            default:
                ImageSource = new Uri("pack://application:,,,/BPiaoBao.Client.UIExt;component/Image/info.png");
                break;
            }

            switch (MessageBoxButtonType)
            {
            case UIExt.MessageBoxButtonType.OK:
                BtnCancel.Visibility = System.Windows.Visibility.Collapsed;
                break;

            case UIExt.MessageBoxButtonType.OKCancel:
                BtnCancel.Visibility = System.Windows.Visibility.Visible;
                break;
            }
        }
コード例 #7
0
        public MessageBoxResultType ShowMessageBox(string message, MessageBoxButtonType buttonType)
        {
            var log = Mvx.IoCProvider.Resolve <IMvxLog>();

            log.Debug("MessageBoxService: Show Message:{0}", message);

            MessageBoxResultType messageBoxResult = MessageBoxResultType.None;
            bool success = true;

            message = AppResources.ResourceManager.GetString(message, AppResources.Culture);

            if (buttonType == MessageBoxButtonType.OK)
            {
                success = messageBoxResultDictionary.TryGetValue(MessageBox.Show(message, "InfonetPOS", MessageBoxButton.OK), out messageBoxResult);
            }
            else if (buttonType == MessageBoxButtonType.OKCancel)
            {
                success = messageBoxResultDictionary.TryGetValue(MessageBox.Show(message, "InfonetPOS", MessageBoxButton.OKCancel), out messageBoxResult);
            }
            else if (buttonType == MessageBoxButtonType.YesNo)
            {
                success = messageBoxResultDictionary.TryGetValue(MessageBox.Show(message, "InfonetPOS", MessageBoxButton.YesNo), out messageBoxResult);
            }
            else if (buttonType == MessageBoxButtonType.YesNoCancel)
            {
                success = messageBoxResultDictionary.TryGetValue(MessageBox.Show(message, "InfonetPOS", MessageBoxButton.YesNoCancel), out messageBoxResult);
            }

            if (success)
            {
                log.Debug("MessageBoxService: Succeesfully showed MessageBox to user and return MessageBoxResult.");
                return(messageBoxResult);
            }
            else
            {
                log.Error("MessageBoxService: Error while showing MessageBox.");
                return(MessageBoxResultType.None);
            }
        }
コード例 #8
0
ファイル: MessageBox.cs プロジェクト: debrogile/Azelea.WPF
        public static bool? Show(string message, string caption, MessageBoxButtonType type)
        {
            var win = new MessageBoxWindow();
            win.Title = caption;
            win.Message = message;

            var buttons = new List<MessageBoxButton>();
            if (type == MessageBoxButtonType.OK)
            {
                buttons.Add(new MessageBoxButton { Text = "确定", Result = true });
            }
            else if (type == MessageBoxButtonType.OKCancel)
            {
                buttons.Add(new MessageBoxButton { Text = "确定", Result = true });
                buttons.Add(new MessageBoxButton { Text = "取消", Result = false });
            }
            else if (type == MessageBoxButtonType.YesNoCancel)
            {
                buttons.Add(new MessageBoxButton { Text = "是", Result = true });
                buttons.Add(new MessageBoxButton { Text = "否", Result = false });
                buttons.Add(new MessageBoxButton { Text = "取消" });
            }
            else if (type == MessageBoxButtonType.YesNo)
            {
                buttons.Add(new MessageBoxButton { Text = "是", Result = true });
                buttons.Add(new MessageBoxButton { Text = "否", Result = false });
            }
            win.Buttons = buttons;

            var owner = Application.Current.Windows.OfType<Window>().FirstOrDefault(x => x.IsActive);
            if (owner != null)
            {
                win.Owner = owner;
                win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            }

            return win.ShowDialog();
        }
コード例 #9
0
ファイル: MessageBoxExt.cs プロジェクト: goldmon/BPiaoBao
        /// <summary>
        /// 对话框
        /// </summary>
        /// <param name="title">显示对话框标题</param>
        /// <param name="content">消息内容</param>
        /// <param name="messageImageType">显示图片</param>
        /// <param name="messageBoxButtonType">按钮方式</param>
        /// <returns></returns>
        public static bool?Show(string title, string content, MessageImageType messageImageType, MessageBoxButtonType messageBoxButtonType = MessageBoxButtonType.OK)
        {
            bool?result = null;
            //Application.Current.Dispatcher.Invoke(new Action(() =>
            //   {
            PopupWindow pop = new PopupWindow(content, messageImageType, messageBoxButtonType);

            pop.Title = title;
            if (Application.Current.MainWindow != pop)
            {
                pop.Owner = Application.Current.MainWindow;
            }
            pop.ShowDialog();
            result = pop.DialogResult;
            //}));
            return(result);
        }
コード例 #10
0
ファイル: MessageBox.cs プロジェクト: debrogile/Azelea.WPF
 public static bool? Show(string message, MessageBoxButtonType type)
 {
     return Show(message, "系统提示", MessageBoxButtonType.OK);
 }
コード例 #11
0
        private Button[] GetShowButtons(MessageBoxButtonType messageBoxButtonType)
        {
            bool[] visiables = null;
            switch (messageBoxButtonType)
            {
            case MessageBoxButtonType.Repair:
                visiables    = new bool[] { true, false, false };
                button1.Text = "Repair";
                break;

            case MessageBoxButtonType.None:
                visiables = new bool[] { false, false, false };
                break;

            case MessageBoxButtonType.OK:
                visiables    = new bool[] { true, false, false };
                button1.Text = "OK";
                break;

            case MessageBoxButtonType.InputUpdata:
                visiables    = new bool[] { true, true, false };
                button1.Text = "Updata";
                button2.Text = "Input";
                break;

            case MessageBoxButtonType.InPutGetUpdata:
                visiables    = new bool[] { true, false, false };
                button1.Text = "Updata";
                break;

            case MessageBoxButtonType.RetryCancel:
                visiables    = new bool[] { true, true, false };
                button1.Text = "Retry";
                button2.Text = "Cancel";
                break;

            case MessageBoxButtonType.RetryGetCancel:
                visiables    = new bool[] { true, true, true };
                button1.Text = "GetInfo";
                button2.Text = "Retry";
                button3.Text = "Cancel";
                break;

            case MessageBoxButtonType.YesCancel:
                visiables    = new bool[] { true, true, false };
                button1.Text = "Yes";
                button2.Text = "Cancel";
                break;

            case MessageBoxButtonType.InPutDeleteUpdata:
                visiables    = new bool[] { true, true, false };
                button1.Text = "Updata";
                button2.Text = "Input";
                break;

            default:
                break;
            }
            if (visiables != null)
            {
                return(ButtonsVisible(visiables));
            }
            else
            {
                return(null);
            }
        }
コード例 #12
0
ファイル: MessageBox.cs プロジェクト: wakapippi/Tempest-Wave
 public void SetResult(MessageBoxButtonType result)
 {
     Result       = result;
     ResultExists = true;
 }
コード例 #13
0
        private static bool?ShowWindow(string text, string caption, MessageBoxButtonType buttons)
        {
            MessageWindow window = new MessageWindow(text, caption, buttons);

            return(window.DrawWindows());
        }
コード例 #14
0
 public static bool?Show(string text, string caption, MessageBoxButtonType buttons)
 {
     return(ShowWindow(text, caption, buttons));
 }