Ejemplo n.º 1
0
            public TaskPaneContentCloser(MgTaskPane taskPane, MgControlView control)
            {
                _taskPane = taskPane;
                _control  = control;

                _control.Closer = this;
                _taskPane.SetContent(_control);
            }
Ejemplo n.º 2
0
            public NewWindowContentCloser(MgControlView control, Form owner)
            {
                _frm     = new Form();
                _control = control;
                Rectangle screenRectangle = _frm.RectangleToScreen(_frm.ClientRectangle);
                int       titleHeight     = screenRectangle.Top - _frm.Top;

                _frm.Width  = Math.Max(_control.Size.Width, _control.PreferredSize.Width);
                _frm.Height = Math.Max(_control.Size.Height, _control.PreferredSize.Height) + titleHeight + 10; //HACK: height calculation is imperfect, so pad out
                _frm.Text   = _control.Title;
                _frm.Controls.Add(_control);
                _control.Closer = this;

                if (control.ModalWindow)
                {
                    _frm.ShowDialog(owner);
                }
                else
                {
                    _frm.Show(owner);
                }
            }
Ejemplo n.º 3
0
            public NewWindowContentCloser(MgControlView control, Form owner)
            {
                _frm = new Form();
                _control = control;
                Rectangle screenRectangle = _frm.RectangleToScreen(_frm.ClientRectangle);
                int titleHeight = screenRectangle.Top - _frm.Top;
                _frm.Width = Math.Max(_control.Size.Width, _control.PreferredSize.Width);
                _frm.Height = Math.Max(_control.Size.Height, _control.PreferredSize.Height) + titleHeight + 10; //HACK: height calculation is imperfect, so pad out
                _frm.Text = _control.Title;
                _frm.Controls.Add(_control);
                _control.Closer = this;

                if (control.ModalWindow)
                    _frm.ShowDialog(owner);
                else
                    _frm.Show(owner);
            }
Ejemplo n.º 4
0
            public TaskPaneContentCloser(MgTaskPane taskPane, MgControlView control)
            {
                _taskPane = taskPane;
                _control = control;

                _control.Closer = this;
                _taskPane.SetContent(_control);
            }