Exemplo n.º 1
0
        public void AddModal(WindowHost host)
        {
            currentModalChild  = host;
            CursorType         = CursorType.Default;
            EnableManipulation = false;

            AddChild(host);
        }
Exemplo n.º 2
0
 private void CurrentChild_Disposed(object sender, EventArgs e)
 {
     currentChild.Disposed        -= CurrentChild_Disposed;
     currentChild.LocationChanged -= CurrentChild_LocationChanged;
     RemoveOwnedForm(currentChild);
     currentChild       = null;
     currentModalChild  = null;
     EnableManipulation = true;
 }
Exemplo n.º 3
0
        public void AddChild(WindowHost host)
        {
            currentChild                  = host;
            currentChild.Disposed        += CurrentChild_Disposed;
            currentChild.LocationChanged += CurrentChild_LocationChanged;

            host.StartPosition = FormStartPosition.Manual;

            var offset = PointToScreen(Point.Empty);

            offset.X -= Location.X;
            offset.Y -= Location.Y;

            offset.X += (ClientSize.Width - currentChild.Size.Width) / 2;
            offset.Y += (ClientSize.Height - currentChild.Size.Height) / 2;

            childRelativePosition = offset;

            AddOwnedForm(host);
            OnLocationChanged(this, EventArgs.Empty);
        }