public static MessageBoxButtons GetButtons(MessageWindowButtons buttons) { switch(buttons) { case MessageWindowButtons.Cancel: return MessageBoxButtons.OKCancel; case MessageWindowButtons.OkCancel: return MessageBoxButtons.OKCancel; case MessageWindowButtons.YesNo: return MessageBoxButtons.YesNo; case MessageWindowButtons.YesNoCancel: return MessageBoxButtons.YesNoCancel; case MessageWindowButtons.RetryCancel: return MessageBoxButtons.RetryCancel; case MessageWindowButtons.AbortRetryIgnore: return MessageBoxButtons.AbortRetryIgnore; case MessageWindowButtons.Close: case MessageWindowButtons.None: case MessageWindowButtons.Ok: default: return MessageBoxButtons.OK; } }
public static MessageBoxButtons GetButtons(MessageWindowButtons buttons) { switch (buttons) { case MessageWindowButtons.Cancel: return(MessageBoxButtons.OKCancel); case MessageWindowButtons.OkCancel: return(MessageBoxButtons.OKCancel); case MessageWindowButtons.YesNo: return(MessageBoxButtons.YesNo); case MessageWindowButtons.YesNoCancel: return(MessageBoxButtons.YesNoCancel); case MessageWindowButtons.RetryCancel: return(MessageBoxButtons.RetryCancel); case MessageWindowButtons.AbortRetryIgnore: return(MessageBoxButtons.AbortRetryIgnore); case MessageWindowButtons.Close: case MessageWindowButtons.None: case MessageWindowButtons.Ok: default: return(MessageBoxButtons.OK); } }
public MessageWindowOptions(string message, string caption, MessageWindowButtons buttons, ImageSource image, MessageWindowResultKind defaultResult) { MessageText = message; Caption = caption; Buttons = buttons; ImageSource = image; DefaultResult = defaultResult; }
public MessageWindowViewModel(MessageWindowButtons buttons) { Response = MessageWindowResponse.Cancel; _buttons = buttons; ButtonRightCommand = new DelegateCommand(ExecuteButtonRight); //CanExecuteButtonRight == true ButtonMiddleCommand = new DelegateCommand(ExecuteButtonMiddle, CanExecuteButtonMiddle); ButtonLeftCommand = new DelegateCommand(ExecuteButtonLeft, CanExecuteButtonLeft); }
public MessageWindow(string title, string text, MessageWindowButtons buttons) { WindowTitle = title; Text = text; DataContext = this; Owner = App.Current.MainWindow; Result = MessageWindowResult.Unknown; WindowStartupLocation = WindowStartupLocation.CenterOwner; InitializeComponent(); ShowButtons(buttons); }
public MessageWindow(string message, string caption, MessageWindowButtons buttons, MessageWindowIcon icon) { InitializeComponent(); MessageText.Text = message; Title = caption; SetButtons(buttons); SetIcon(icon); _messageWindowVM = new MessageWindowViewModel(buttons); _messageWindowVM.CloseViewAction = delegate(bool?result) { DialogResult = result; }; DataContext = _messageWindowVM; }
public override WindowResponse Show(object parent, string message, string title, MessageWindowType type, MessageWindowButtons bType) { NSAlert al = new NSAlert(); al.AlertStyle = CocoaHelper.GetWinType(type); al.MessageText = title; al.InformativeText = message; switch (bType) { case MessageWindowButtons.AbortRetryIgnore: al.AddButton(Message.GetString("Abort")); al.AddButton(Message.GetString("Retry")); al.AddButton(Message.GetString("Ignore")); break; case MessageWindowButtons.Cancel: al.AddButton(Message.GetString("Cancel")); break; case MessageWindowButtons.Close: al.AddButton(Message.GetString("Close")); break; case MessageWindowButtons.Ok: al.AddButton(Message.GetString("Ok")); break; case MessageWindowButtons.OkCancel: al.AddButton(Message.GetString("Ok")); al.AddButton(Message.GetString("Cancel")); break; case MessageWindowButtons.RetryCancel: al.AddButton(Message.GetString("Retry")); al.AddButton(Message.GetString("Cancel")); break; case MessageWindowButtons.YesNo: al.AddButton(Message.GetString("Yes")); al.AddButton(Message.GetString("No")); break; case MessageWindowButtons.YesNoCancel: al.AddButton(Message.GetString("Yes")); al.AddButton(Message.GetString("No")); al.AddButton(Message.GetString("Cancel")); break; } WindowResponse resp = CocoaHelper.GetResponse(al.RunModal(), bType); al.Dispose(); return resp; }
private void ShowButtons(MessageWindowButtons type) { switch (type) { case MessageWindowButtons.OK: frmOptions.Navigate(new ButtonsOK(this)); break; case MessageWindowButtons.OKCancel: frmOptions.Navigate(new ButtonsOkCancel(this)); break; case MessageWindowButtons.YesNo: frmOptions.Navigate(new ButtonsYesNo(this)); break; } }
public static WindowResponse GetResponse(int resp, MessageWindowButtons bType) { switch (bType) { case MessageWindowButtons.AbortRetryIgnore: if(resp == 1000) return WindowResponse.Cancel; else if(resp == 1001) return WindowResponse.Retry; else if(resp == 1002) return WindowResponse.Ignore; break; case MessageWindowButtons.Cancel: if(resp == 1000) return WindowResponse.Cancel; break; case MessageWindowButtons.Close: if(resp == 1000) return WindowResponse.Close; break; case MessageWindowButtons.Ok: if(resp == 1000) return WindowResponse.Ok; break; case MessageWindowButtons.OkCancel: if(resp == 1000) return WindowResponse.Ok; else if(resp == 1001) return WindowResponse.Cancel; break; case MessageWindowButtons.RetryCancel: if(resp == 1000) return WindowResponse.Retry; else if(resp == 1001) return WindowResponse.Cancel; break; case MessageWindowButtons.YesNo: if(resp == 1000) return WindowResponse.Yes; else if(resp == 1001) return WindowResponse.No; break; case MessageWindowButtons.YesNoCancel: if(resp == 1000) return WindowResponse.Yes; else if(resp == 1001) return WindowResponse.No; else if(resp == 1002) return WindowResponse.Cancel; break; case MessageWindowButtons.None: default: return WindowResponse.None; } return WindowResponse.None; }
public override WindowResponse Show(object parent, string message, string title, MessageWindowType type, MessageWindowButtons bType) { Window p = (Window)parent; MessageType t = GtkHelper.GetWinType(type); MessageDialog md = new MessageDialog(p, DialogFlags.Modal, t, ButtonsType.None, message); md.Title = title; if (p != null && p.Icon != null) { md.Icon = p.Icon; } md.WindowPosition = WindowPosition.CenterOnParent; if (bType == MessageWindowButtons.Ok || bType == MessageWindowButtons.OkCancel) md.AddButton(Message.GetString("Ok"), ResponseType.Ok); if (bType == MessageWindowButtons.Close) md.AddButton(Message.GetString("Close"), ResponseType.Close); if (bType == MessageWindowButtons.YesNo || bType == MessageWindowButtons.YesNoCancel) { md.AddButton(Message.GetString("Yes"), ResponseType.Yes); md.AddButton(Message.GetString("No"), ResponseType.No); } if (bType == MessageWindowButtons.AbortRetryIgnore || bType == MessageWindowButtons.RetryCancel) md.AddButton(Message.GetString("Retry"), ResponseType.Accept); if (bType == MessageWindowButtons.AbortRetryIgnore) md.AddButton(Message.GetString("Ignore"), ResponseType.Reject); if (bType == MessageWindowButtons.Cancel || bType == MessageWindowButtons.OkCancel || bType == MessageWindowButtons.RetryCancel || bType == MessageWindowButtons.YesNoCancel || bType == MessageWindowButtons.AbortRetryIgnore) md.AddButton(Message.GetString("Cancel"), ResponseType.Cancel); ResponseType result = (ResponseType)md.Run(); md.Destroy(); return GtkHelper.GetResponse(result); }
public override WindowResponse Show(object parent, string message, string title, MessageWindowType type, MessageWindowButtons bType) { if (parent != null) { return(WinFormHelper.GetResponse(MessageBox.Show(message, title, WinFormHelper.GetButtons(bType), WinFormHelper.GetWinType(type)))); } else { return(WinFormHelper.GetResponse(MessageBox.Show((IWin32Window)parent, message, title, WinFormHelper.GetButtons(bType), WinFormHelper.GetWinType(type)))); } }
public override WindowResponse Show(object parent, string message, string title, MessageWindowType type, MessageWindowButtons bType) { NSAlert al = new NSAlert(); al.AlertStyle = CocoaHelper.GetWinType(type); al.MessageText = title; al.InformativeText = message; switch (bType) { case MessageWindowButtons.AbortRetryIgnore: al.AddButton(Message.GetString("Abort")); al.AddButton(Message.GetString("Retry")); al.AddButton(Message.GetString("Ignore")); break; case MessageWindowButtons.Cancel: al.AddButton(Message.GetString("Cancel")); break; case MessageWindowButtons.Close: al.AddButton(Message.GetString("Close")); break; case MessageWindowButtons.Ok: al.AddButton(Message.GetString("Ok")); break; case MessageWindowButtons.OkCancel: al.AddButton(Message.GetString("Ok")); al.AddButton(Message.GetString("Cancel")); break; case MessageWindowButtons.RetryCancel: al.AddButton(Message.GetString("Retry")); al.AddButton(Message.GetString("Cancel")); break; case MessageWindowButtons.YesNo: al.AddButton(Message.GetString("Yes")); al.AddButton(Message.GetString("No")); break; case MessageWindowButtons.YesNoCancel: al.AddButton(Message.GetString("Yes")); al.AddButton(Message.GetString("No")); al.AddButton(Message.GetString("Cancel")); break; } WindowResponse resp = CocoaHelper.GetResponse(al.RunModal(), bType); al.Dispose(); return(resp); }
public static WindowResponse GetResponse(int resp, MessageWindowButtons bType) { switch (bType) { case MessageWindowButtons.AbortRetryIgnore: if (resp == 1000) { return(WindowResponse.Cancel); } else if (resp == 1001) { return(WindowResponse.Retry); } else if (resp == 1002) { return(WindowResponse.Ignore); } break; case MessageWindowButtons.Cancel: if (resp == 1000) { return(WindowResponse.Cancel); } break; case MessageWindowButtons.Close: if (resp == 1000) { return(WindowResponse.Close); } break; case MessageWindowButtons.Ok: if (resp == 1000) { return(WindowResponse.Ok); } break; case MessageWindowButtons.OkCancel: if (resp == 1000) { return(WindowResponse.Ok); } else if (resp == 1001) { return(WindowResponse.Cancel); } break; case MessageWindowButtons.RetryCancel: if (resp == 1000) { return(WindowResponse.Retry); } else if (resp == 1001) { return(WindowResponse.Cancel); } break; case MessageWindowButtons.YesNo: if (resp == 1000) { return(WindowResponse.Yes); } else if (resp == 1001) { return(WindowResponse.No); } break; case MessageWindowButtons.YesNoCancel: if (resp == 1000) { return(WindowResponse.Yes); } else if (resp == 1001) { return(WindowResponse.No); } else if (resp == 1002) { return(WindowResponse.Cancel); } break; case MessageWindowButtons.None: default: return(WindowResponse.None); } return(WindowResponse.None); }
public abstract WindowResponse Show(object parent, string message, string title, MessageWindowType type, MessageWindowButtons bType);
public static void Show(NativeWindow owner, string message, string caption, MessageWindowButtons buttons, MessageBoxImage image, MessageWindowResultKind defaultResult, Action <MessageWindowResult> onMessageResult) { ShowImpl(owner, new MessageWindowOptions(message, caption, buttons, image, defaultResult), onMessageResult); }
public WindowResponse Show(string message, string title, MessageWindowType type, MessageWindowButtons bType) { return(this.Show(null, message, title, type, bType)); }
public WindowResponse Show(string message, string title, MessageWindowType type, MessageWindowButtons bType) { return this.Show(null, message, title, type, bType); }
public WindowResponse Show(object parent, string message, MessageWindowType type, MessageWindowButtons bType) { return(this.Show(parent, message, GetTitle(type), type, bType)); }
public override WindowResponse Show(object parent, string message, string title, MessageWindowType type, MessageWindowButtons bType) { Window p = (Window)parent; MessageType t = GtkHelper.GetWinType(type); MessageDialog md = new MessageDialog(p, DialogFlags.Modal, t, ButtonsType.None, message); md.Title = title; if (p != null && p.Icon != null) { md.Icon = p.Icon; } md.WindowPosition = WindowPosition.CenterOnParent; if (bType == MessageWindowButtons.Ok || bType == MessageWindowButtons.OkCancel) { md.AddButton(Message.GetString("Ok"), ResponseType.Ok); } if (bType == MessageWindowButtons.Close) { md.AddButton(Message.GetString("Close"), ResponseType.Close); } if (bType == MessageWindowButtons.YesNo || bType == MessageWindowButtons.YesNoCancel) { md.AddButton(Message.GetString("Yes"), ResponseType.Yes); md.AddButton(Message.GetString("No"), ResponseType.No); } if (bType == MessageWindowButtons.AbortRetryIgnore || bType == MessageWindowButtons.RetryCancel) { md.AddButton(Message.GetString("Retry"), ResponseType.Accept); } if (bType == MessageWindowButtons.AbortRetryIgnore) { md.AddButton(Message.GetString("Ignore"), ResponseType.Reject); } if (bType == MessageWindowButtons.Cancel || bType == MessageWindowButtons.OkCancel || bType == MessageWindowButtons.RetryCancel || bType == MessageWindowButtons.YesNoCancel || bType == MessageWindowButtons.AbortRetryIgnore) { md.AddButton(Message.GetString("Cancel"), ResponseType.Cancel); } ResponseType result = (ResponseType)md.Run(); md.Destroy(); return(GtkHelper.GetResponse(result)); }
public static MessageWindowResponse ShowTopMost(string message, string caption, MessageWindowButtons buttons, MessageWindowIcon icon) { var messageWindow = new MessageWindow(message, caption, buttons, icon); TopMostHelper.ShowDialogTopMost(messageWindow, false); return(messageWindow.DialogResponse); }
private void SetButtons(MessageWindowButtons buttons) { Translator translator = TranslationHelper.Instance.TranslatorInstance; switch (buttons) { case MessageWindowButtons.MoreInfoCancel: LeftButton.Visibility = Visibility.Visible; LeftButton.Content = translator.GetTranslation("MessageWindow", "MoreInfo", "More information"); LeftButton.IsDefault = true; MiddleButton.Visibility = Visibility.Collapsed; RightButton.Visibility = Visibility.Visible; RightButton.Content = translator.GetTranslation("MessageWindow", "Cancel", "Cancel"); RightButton.Tag = MessageWindowResponse.Cancel; break; case MessageWindowButtons.OK: RightButton.Visibility = Visibility.Visible; RightButton.Content = translator.GetTranslation("MessageWindow", "Ok", "OK"); RightButton.IsDefault = true; break; case MessageWindowButtons.OKCancel: LeftButton.Visibility = Visibility.Visible; LeftButton.Content = translator.GetTranslation("MessageWindow", "Ok", "OK"); LeftButton.IsDefault = true; MiddleButton.Visibility = Visibility.Collapsed; RightButton.Visibility = Visibility.Visible; RightButton.Content = translator.GetTranslation("MessageWindow", "Cancel", "Cancel"); RightButton.Tag = MessageWindowResponse.Cancel; break; case MessageWindowButtons.RetryCancel: LeftButton.Visibility = Visibility.Visible; LeftButton.Content = translator.GetTranslation("MessageWindow", "Retry", "Retry"); LeftButton.IsDefault = true; MiddleButton.Visibility = Visibility.Collapsed; RightButton.Visibility = Visibility.Visible; RightButton.Content = translator.GetTranslation("MessageWindow", "Cancel", "Cancel"); RightButton.Tag = MessageWindowResponse.Cancel; break; case MessageWindowButtons.YesLaterNo: LeftButton.Visibility = Visibility.Visible; LeftButton.Content = translator.GetTranslation("MessageWindow", "Yes", "Yes"); LeftButton.IsDefault = true; MiddleButton.Visibility = Visibility.Visible; MiddleButton.Content = translator.GetTranslation("MessageWindow", "Later", "Remind me"); RightButton.Visibility = Visibility.Visible; RightButton.Content = translator.GetTranslation("MessageWindow", "Skip", "Skip version"); break; case MessageWindowButtons.YesNo: LeftButton.Visibility = Visibility.Visible; LeftButton.Content = translator.GetTranslation("MessageWindow", "Yes", "Yes"); LeftButton.IsDefault = true; MiddleButton.Visibility = Visibility.Collapsed; RightButton.Visibility = Visibility.Visible; RightButton.Content = translator.GetTranslation("MessageWindow", "No", "No"); break; } }
public abstract WindowResponse Show(object parent, string message, string title, MessageWindowType type, MessageWindowButtons bType);
public override WindowResponse Show(object parent, string message, string title, MessageWindowType type, MessageWindowButtons bType) { if (parent != null) return WinFormHelper.GetResponse(MessageBox.Show(message, title, WinFormHelper.GetButtons(bType), WinFormHelper.GetWinType(type))); else return WinFormHelper.GetResponse(MessageBox.Show((IWin32Window)parent, message, title, WinFormHelper.GetButtons(bType), WinFormHelper.GetWinType(type))); }
public WindowResponse Show(object parent, string message, MessageWindowType type, MessageWindowButtons bType) { return this.Show(parent, message, GetTitle(type), type, bType); }
public void Show(string text, MessageWindowButtons buttons) { }