/// <summary> /// Add our collection of hotzones into redocker. /// </summary> /// <param name="redock">Redocker target.</param> /// <param name="collection">Collection of hotzones.</param> public void AddHotZones(Redocker redock, HotZoneCollection collection) { RedockerContent redocker = redock as RedockerContent; // Allow the contained Zone a chance to expose HotZones foreach (Control c in this.Controls) { IHotZoneSource ag = c as IHotZoneSource; // Does this control expose an interface for its own HotZones? if (ag != null) { ag.AddHotZones(redock, collection); } } }
/// <summary> /// Perform initialization. /// </summary> /// <param name="squares">Show squares or diamonds.</param> /// <param name="callingControl">Calling control instance.</param> /// <param name="source">Type of source.</param> /// <param name="c">Source content.</param> /// <param name="wc">WindowContent that contains content.</param> /// <param name="ff">Floating form source.</param> /// <param name="dm">DockingManager instance.</param> /// <param name="offset">Screen offset.</param> protected override void InternalConstruct(bool squares, Control callingControl, Source source, Content c, WindowContent wc, FloatingForm ff, DockingManager dm, Point offset) { // Initialize zone specific details _hotZones = null; _currentHotZone = null; // Let base class store information base.InternalConstruct(squares, callingControl, source, c, wc, ff, dm, offset); }
/// <summary> /// Add the collection of hot zones. /// </summary> /// <param name="redock">Reference to a redocker instance.</param> /// <param name="collection">Collection of hot zones.</param> public void AddHotZones(Redocker redock, HotZoneCollection collection) { RedockerContent redocker = redock as RedockerContent; bool itself = false; bool nullZone = false; // We process differently for WindowContent to redock into itself! if ((redocker.WindowContent != null) && (redocker.WindowContent == this)) { itself = true; } // We do not allow a Content to redock into its existing container if (itself && !Contents.Contains(redocker.Content)) { nullZone = true; } Rectangle newSize = this.RectangleToScreen(this.ClientRectangle); Rectangle hotArea = _tabControl.RectangleToScreen(_tabControl.ClientRectangle);; // Find any caption detail and use that area as the hot area foreach (WindowDetail wd in WindowDetails) { WindowDetailCaption wdc = wd as WindowDetailCaption; if (wdc != null) { hotArea = wdc.RectangleToScreen(wdc.ClientRectangle); hotArea.Inflate(_hotAreaInflate, _hotAreaInflate); break; } } if (nullZone) { collection.Add(new HotZoneNull(hotArea)); } else { collection.Add(new HotZoneTabbed(hotArea, newSize, this, itself)); } }
private void GenerateHotZones() { // Need the client rectangle for the whole Form Rectangle formClient = Container.RectangleToScreen(Container.ClientRectangle); // Create a fresh collection for HotZones _hotZones = new HotZoneCollection(); GenerateHotZonesForTop(_topList, formClient, VectorV, _outerIndex); GenerateHotZonesForLeft(_leftList, formClient, VectorH, _outerIndex); GenerateHotZonesForRight(_rightList, formClient, VectorH, _outerIndex); GenerateHotZonesForBottom(_bottomList, formClient, VectorV, _outerIndex); GenerateHotZonesForFill(_fillList, _outerIndex); // Allow provide the floating zone if we are allowed floating windows if (DockingManager.AllowFloating) { GenerateHotZonesForFloating(SizeDependsOnSource()); } }