Пример #1
0
 private void DisposeForm()
 {
     if (_form != null)
     {
         _form.Dispose();
         _form = null;
     }
 }
Пример #2
0
		public static void Show(string name, string description, string text)
		{
			ShowValueDialog dialog = new ShowValueDialog(text);
			DialogBoxForm form = new DialogBoxForm(dialog, new ImagePropertyDetailControl(name, description, text));
			form.Text = SR.TitleDetails;
			form.CancelButton = new CancelController(form);
			form.StartPosition = FormStartPosition.Manual;
			form.DesktopLocation = Cursor.Position - new Size(form.DesktopBounds.Width/2, form.DesktopBounds.Height/2);
			form.ShowDialog();
			form.Dispose();
		}
Пример #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="dialogBox"></param>
        /// <param name="owner"></param>
        protected internal DialogBoxView(DialogBox dialogBox, DesktopWindowView owner)
        {
            IApplicationComponentView componentView = dialogBox.ComponentView;

            // cache the app component - we'll need it later to get the ExitCode
            _component = (IApplicationComponent)dialogBox.Component;

            _form = CreateDialogBoxForm(dialogBox, (Control)componentView.GuiElement);
            _form.FormClosing += new FormClosingEventHandler(_form_FormClosing);

            _owner = owner.DesktopForm;
        }
Пример #4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="dialogBox"></param>
        /// <param name="owner"></param>
        protected internal DialogBoxView(DialogBox dialogBox, DesktopWindowView owner)
        {
            IApplicationComponentView componentView = (IApplicationComponentView)ViewFactory.CreateAssociatedView(dialogBox.Component.GetType());

            componentView.SetComponent((IApplicationComponent)dialogBox.Component);

            // cache the app component - we'll need it later to get the ExitCode
            _component = (IApplicationComponent)dialogBox.Component;

            _form              = CreateDialogBoxForm(dialogBox, (Control)componentView.GuiElement);
            _form.FormClosing += new FormClosingEventHandler(_form_FormClosing);

            _owner = owner.DesktopForm;
        }
Пример #5
0
		protected override ExceptionDialogAction Show()
		{
			var control = new ExceptionDialogControl(Exception, Message, Actions, CloseForm, CloseForm);
			_form = new DialogBoxForm(Title, control, Size.Empty, DialogSizeHint.Auto);

			var screen = ScreenFromActiveForm() ?? ScreenFromMousePosition();
			int xdiff = screen.Bounds.Width - _form.Bounds.Width;
			int ydiff = screen.Bounds.Height - _form.Bounds.Height;
			int locationX = screen.WorkingArea.Left + Math.Max(0, (xdiff)/2);
			int locationY = screen.WorkingArea.Top + Math.Max(0, (ydiff)/2);

			_form.StartPosition = FormStartPosition.Manual;
			_form.Location = new Point(locationX, locationY);
			//_form.TopMost = true;
			_form.ShowDialog();

			return control.Result;
		}
Пример #6
0
        protected override ExceptionDialogAction Show()
        {
            var control = new ExceptionDialogControl(Exception, Message, Actions, CloseForm, CloseForm);

            _form = new DialogBoxForm(Title, control, Size.Empty, DialogSizeHint.Auto);

            var screen    = ScreenFromActiveForm() ?? ScreenFromMousePosition();
            int xdiff     = screen.Bounds.Width - _form.Bounds.Width;
            int ydiff     = screen.Bounds.Height - _form.Bounds.Height;
            int locationX = screen.WorkingArea.Left + Math.Max(0, (xdiff) / 2);
            int locationY = screen.WorkingArea.Top + Math.Max(0, (ydiff) / 2);

            _form.StartPosition = FormStartPosition.Manual;
            _form.Location      = new Point(locationX, locationY);
            //_form.TopMost = true;
            _form.ShowDialog();

            return(control.Result);
        }
Пример #7
0
		private void DisposeForm()
		{
			if (_form != null)
			{
				_form.Dispose();
				_form = null;
			}
		}