示例#1
0
 protected void DeteleButton_Click(object sender, MessageBoxEventArgs e)
 {
     if (UserControl_DeteleButton_Click != null)
     {
         UserControl_DeteleButton_Click(sender, e);
     }
 }
示例#2
0
        private void ShowMessageBox(MessageBoxEventArgs args)
        {
            MessageBoxButton buttons;
            MessageBoxImage  image;

            switch (args.Type)
            {
            case MessageBoxType.Information:
                buttons = MessageBoxButton.OK;
                image   = MessageBoxImage.Information;
                break;

            case MessageBoxType.Warning:
                buttons = MessageBoxButton.OK;
                image   = MessageBoxImage.Warning;
                break;

            case MessageBoxType.Error:
                buttons = MessageBoxButton.OK;
                image   = MessageBoxImage.Error;
                break;

            case MessageBoxType.Question:
                buttons = MessageBoxButton.YesNo;
                image   = MessageBoxImage.Question;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            // TODO return ButtonResult?
            _dialogService.ShowMessageBox(args.Message, buttons, image, result => args.Callback?.Invoke(result == ButtonResult.OK || result == ButtonResult.Yes));
        }
示例#3
0
 public void OnActionMenu(MessageBoxEventArgs e)
 {
     if (ActionMenu != null)
     {
         ActionMenu(this, e);
     }
 }
示例#4
0
 public void OnActionNext(MessageBoxEventArgs e)
 {
     if (ActionNext != null)
     {
         ActionNext(this, e);
     }
 }
示例#5
0
 private void RestartController(Object sender, MessageBoxEventArgs e)
 {
     if (e.DialogResult == DialogResult.Yes)
     {
         this.rwSystem.Controller.Restart();
     }
     //ErrorHandler.AddErrorMessage("MichaelLog",string.Format("{0},{1},{2}",e.ButtonText,e.DialogResult,e.State));
 }
示例#6
0
        private void OnMessageBoxRequest(object sender, MessageBoxEventArgs e)
        {
            MessageBoxResult r = MessageBox.Show(e.MessageBoxText, e.Caption, e.MessageBoxButton, e.MessageBoxImage);

            if (e.ResultAction != null)
            {
                e.ResultAction(r);
            }
        }
示例#7
0
 private void _controller_ConfirmAction(object sender, MessageBoxEventArgs e)
 {
     if (_controller.CheckModifications())
     {
         if (MessageBox.Show("You currently have unsaved changes.  " + e.Message, "保存されてないぞ!", MessageBoxButtons.OKCancel) != DialogResult.OK)
         {
             e.Cancel = true;
         }
     }
 }
示例#8
0
        private void ViewModel_MessageBoxRequest(object sender, MessageBoxEventArgs e)
        {
            MessageBoxEx msgBox = new MessageBoxEx()
            {
                Owner = this
            };
            MessageBoxExViewModel vm = msgBox.ViewModel as MessageBoxExViewModel;

            vm.Title   = e.Title;
            vm.Text    = e.Text;
            vm.Buttons = e.Buttons;
            vm.Icon    = e.Icon;
            msgBox.ShowDialog();
            e.Callback?.Invoke(vm.Result);
        }
示例#9
0
        protected void DeteleButton_Click(object sender, MessageBoxEventArgs e)
        {
            if (e.Result == MessageBoxResult.Yes)
            {
                if (!AuthorizationRules.TemplateResolution(ActionType.delete,
                                                           Session["SystemUser.objID"].ToString(),
                                                           Frame.TemplateList.SelectedDataKey["objID"].ToString()))
                {
                    Frame.WarningMessageBox.Show();
                    return;
                }

                Frame.TemplateListSource.Delete();
                Frame.TemplateList.ClearSelection();
                EnableItems(false);
            }
        }
示例#10
0
        /// <summary>
        /// Show message e.Text with media e.Media to player.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">Event arguments.</param>
        public void OnShowMessageBox(Object sender, MessageBoxEventArgs args)
        {
            var bar            = SupportActionBar;
            var ft             = this.SupportFragmentManager.BeginTransaction();
            var activeFragment = this.SupportFragmentManager.FindFragmentByTag("active");

            // There could be only one dialog on screen
            if (screenStack.Peek() is GameDialogScreen)
            {
                screenStack.Pop();
            }

            // Now push new dialog to screen
            screenStack.Push(new GameDialogScreen(args.Descriptor));

            bar.SetDisplayHomeAsUpEnabled(false);
            ft.SetTransition(global::Android.Support.V4.App.FragmentTransaction.TransitNone);
            ft.Replace(Resource.Id.fragment, screenStack.Peek(), "active");
            ft.Commit();
        }
示例#11
0
        private void Service_RequestConfirmCloseMessageDialog(object sender, MessageBoxEventArgs e)
        {
            System.Windows.MessageBoxResult result = MessageBox.Show(e.Message, e.Title, MessageBoxButton.YesNoCancel, MessageBoxImage.Information);
            switch (result)
            {
            case System.Windows.MessageBoxResult.Yes:
                e.Result = MessageBoxResult.Yes;
                break;

            case System.Windows.MessageBoxResult.No:
                e.Result = MessageBoxResult.No;
                break;

            case System.Windows.MessageBoxResult.Cancel:
                e.Result = MessageBoxResult.Cancel;
                break;

            default:
                e.Result = MessageBoxResult.None;
                break;
            }
        }
示例#12
0
		private void Core_MessageBoxRequested(object sender, MessageBoxEventArgs e)
		{
			// Displays the message box.
			ShowMessageBox(e.Descriptor);
		}
 protected void OnMessageBoxRequested(MessageBoxEventArgs e)
 {
     MessageBoxRequested?.Invoke(this, e);
 }
示例#14
0
 private void MessageBoxRequested(object sender, MessageBoxEventArgs e)
 {
     e.Show(this);
 }
        private void Document_RequestConfirmCloseMessageDialog(object sender, MessageBoxEventArgs e)
        {
            var service = FileDocumentDialogService.GetService("Kucl.Test.Wpf");

            service.RaiseRequestConfirmCloseMessageDialog(e);
        }
		/// <summary>
		/// Show message e.Text with media e.Media to player.
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">Event arguments.</param>
		public void OnShowMessageBox(Object sender, MessageBoxEventArgs args)
		{
			var bar = SupportActionBar;
			var ft = this.SupportFragmentManager.BeginTransaction ();
			var activeFragment = this.SupportFragmentManager.FindFragmentByTag("active");

			bar.SetDisplayHomeAsUpEnabled (false);
			ft.SetTransition (global::Android.Support.V4.App.FragmentTransaction.TransitNone);
			ft.Replace (Resource.Id.fragment, new ScreenDialog (args.Descriptor), "active");
			ft.Commit ();

			// Delete last fragment
//			if (activeFragment != null)
//				activeFragment.Dispose();
		}
示例#17
0
		/// <summary>
		/// Raises the show message box event.
		/// </summary>
		/// <param name="sender">Sender of event.</param>
		/// <param name="args">Message box event arguments.</param>
		public void OnShowMessageBox(object sender, MessageBoxEventArgs args)
		{
			this.ShowScreen(ScreenType.Dialog, args);
		}
示例#18
0
 private void Core_MessageBoxRequested(object sender, MessageBoxEventArgs e)
 {
     // Displays the message box.
     ShowMessageBox(e.Descriptor);
 }
示例#19
0
        public MessageBox(MessageBoxEventArgs args)
        {
            this.args = args;

            InitializeComponent();
        }
示例#20
0
 public void ShowMessageBox(MessageBoxEventArgs e)
 {
     MessageBoxRequest?.Invoke(this, e);
 }
 private void ViewModelOnRequestMessageBox(object sender, MessageBoxEventArgs e)
 {
     e.Result  = MessageBox.Show(this, e.Text, e.Title, e.Buttons, e.Icon);
     e.Handled = true;
 }
		/// <summary>
		/// Show message e.Text with media e.Media to player.
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">Event arguments.</param>
		public void OnShowMessageBox(Object sender, MessageBoxEventArgs args)
		{
			var bar = SupportActionBar;
			var ft = this.SupportFragmentManager.BeginTransaction ();
			var activeFragment = this.SupportFragmentManager.FindFragmentByTag("active");

			// There could be only one dialog on screen
			if (screenStack.Peek() is GameDialogScreen)
				screenStack.Pop();

			// Now push new dialog to screen
			screenStack.Push(new GameDialogScreen (args.Descriptor));

			bar.SetDisplayHomeAsUpEnabled (false);
			ft.SetTransition (global::Android.Support.V4.App.FragmentTransaction.TransitNone);
			ft.Replace (Resource.Id.fragment, screenStack.Peek(), "active");
			ft.Commit ();
		}
示例#23
0
 public static void InvokeMessageBoxEvent(MessageBoxEventArgs args)
 {
     MessageBoxEvent?.Invoke(args);
 }
示例#24
0
		void MessageBox_ShowMessageBox(object sender, MessageBoxEventArgs e)
		{
			var window = new MessageBox(e) { Owner = Application.Current.MainWindow };

			window.ShowDialog();
		}
 private void ViewModel_MessageBoxRequest(object sender, MessageBoxEventArgs e)
 {
     e.Show(this);
 }
示例#26
0
 private void MainWindow_MessageBoxRequest(object sender, MessageBoxEventArgs e)
 {
     e.Show();
 }
 private void EventSink_MessageBoxEvent(MessageBoxEventArgs args)
 {
     ClientManager.Post(() => ActivatePanelWithMessage(args.Message));
 }
 void MessageBoxRequest(object sender, MessageBoxEventArgs e)
 {
     e.Show();
 }
示例#29
0
 public void OnShowMessageBox(Object sender, MessageBoxEventArgs args)
 {
     ShowScreen(ScreenType.Dialog, args);
 }