private static void UpdateEnabledChanged(AlertDialog alertDialog, DialogButtonType dialogButtonType, bool isEnabled)
 {
     var button = alertDialog.GetButton((int)dialogButtonType);
     button.Enabled = isEnabled;
 }
Exemplo n.º 2
0
        public MessageDialog(DialogButtonType buttons, string primaryLabel, string secondaryLabel, MessageType messageType)
        {
            InicializeComponent();
            //TransientFor = MainClass.MainWindow;

            Buttons = buttons;
            PrimaryText = primaryLabel;
            SecondaryText = secondaryLabel;
            MessageType = messageType;
        }
Exemplo n.º 3
0
        public MessageDialogUrl(DialogButtonType buttons, string primaryLabel, string secondaryLabel,string secondaryUrl, MessageType messageType)
        {
            InicializeComponent();
            TransientFor = MainClass.MainWindow;

            Buttons = buttons;
            PrimaryText = primaryLabel;
            linkBtn.Label = secondaryLabel;
            linkBtn.LinkUrl = secondaryUrl;
            MessageType = messageType;
        }
Exemplo n.º 4
0
        public MessageDialog(DialogButtonType buttons, string primaryLabel, string secondaryLabel, MessageType messageType,Gtk.Window parent)
        {
            InicializeComponent();
            //if (parent == null) parent =MainClass.MainWindow;

            if (parent != null)
                TransientFor =parent;

            Buttons = buttons;
            PrimaryText = primaryLabel;
            SecondaryText = secondaryLabel;
            MessageType = messageType;
        }
Exemplo n.º 5
0
    public Guid ShowDialog(string headerText, string text, DialogType type,
        bool showCancelButton, DialogButtonType? focusedButton)
    {
      Guid dialogHandle = Guid.NewGuid();
      ItemsList buttons = new ItemsList();
      switch (type)
      {
        case DialogType.OkDialog:
          buttons.Add(CreateButtonListItem(OK_BUTTON_TEXT, dialogHandle, DialogResult.Ok, focusedButton == DialogButtonType.Ok || !showCancelButton));
          break;
        case DialogType.YesNoDialog:
          buttons.Add(CreateButtonListItem(YES_BUTTON_TEXT, dialogHandle, DialogResult.Yes, focusedButton == DialogButtonType.Yes));
          buttons.Add(CreateButtonListItem(NO_BUTTON_TEXT, dialogHandle, DialogResult.No, focusedButton == DialogButtonType.No));
          break;
        default:
          throw new NotImplementedException(string.Format("DialogManager: DialogType {0} is not implemented yet", type));
      }
      if (showCancelButton)
        buttons.Add(CreateButtonListItem(CANCEL_BUTTON_TEXT, dialogHandle, DialogResult.Cancel, focusedButton == DialogButtonType.Cancel));

      IScreenManager screenManager = ServiceRegistration.Get<IScreenManager>();
      _dialogData = new GenericDialogData(headerText, text, buttons, dialogHandle);
      Guid? dialogInstanceId = screenManager.ShowDialog(GENERIC_DIALOG_SCREEN, OnDialogClosed);
      if (!dialogInstanceId.HasValue)
        throw new InvalidDataException("Generic dialog could not be shown");
      _dialogData.DialogInstanceId = dialogInstanceId.Value;
      return dialogHandle;
    }
Exemplo n.º 6
0
		protected ICancellableAlert ChangeButton (DialogButtonType type, string title, Func<EventHandler> callback = null)
		{
			Button button;
			if (dialogShown != null && (button = dialogShown.GetButton((int)type)) != null){
				if (callback != null)
					button.Click += (s,e) => callback()(s,e);
				button.Text = title;
				button.Invalidate();
			} else {
				funcButtonsMap [type]?.Invoke (builder, title, (s,e) => callback?.Invoke()(s,e));
			}

			return this;
		}