Example #1
0
        /// <summary>
        /// Restore the zone.
        /// </summary>
        protected void Restore()
        {
            if (_zone != null)
            {
                ContentCollection cc = ZoneHelper.Contents(_zone);

                // Record restore object for each Content
                foreach (Content c in cc)
                {
                    c.RecordFloatingRestore();
                    c.Docked = true;
                }

                // Ensure each content is removed from any Parent
                foreach (Content c in cc)
                {
                    _dockingManager.HideContent(c, false, true);
                }

                // Now restore each of the Content
                foreach (Content c in cc)
                {
                    _dockingManager.ShowContent(c);
                }

                // Finished all changes, no its safe to update inside fill
                _dockingManager.UpdateInsideFill();
                _dockingManager.CheckResized();
            }

            this.Close();
        }
        /// <summary>
        /// Exit hot tracking mode.
        /// </summary>
        /// <param name="e">Mouse event information that triggered call.</param>
        /// <returns></returns>
        public override bool ExitTrackingMode(MouseEventArgs e)
        {
            // Have we exiting tracking mode?
            if (Tracking)
            {
                base.ExitTrackingMode(e);

                // Remove feedback from display
                DragFeedback.Quit();

                // Ensure any additional indicators are removed
                CleanupHotAreas();

                // Is there a current HotZone active?
                if (_currentHotZone != null)
                {
                    // Convert from Control coordinates to screen coordinates
                    Point mousePos = CallingControl.PointToScreen(new Point(e.X, e.Y));

                    // Let the zone apply whatever change it represents
                    bool ret = _currentHotZone.ApplyChange(mousePos, this);

                    // If a change occured, need to recalculate sizing
                    if (ret)
                    {
                        DockingManager.CheckResized();
                    }

                    return(ret);
                }
            }

            return(false);
        }