private void RemoveAllSides() { SuspendLayout(); if (LeftSide != null) { LeftSide.Parent = null; LeftSide.Dispose(); LeftSide = null; } if (TopSide != null) { TopSide.Parent = null; TopSide.Dispose(); TopSide = null; } if (RightSide != null) { RightSide.Parent = null; RightSide.Dispose(); RightSide = null; } if (BottomSide != null) { BottomSide.Parent = null; BottomSide.Dispose(); BottomSide = null; } RootControl.SetBounds( ViewConstants.Spacing, ViewConstants.Spacing, Width - ViewConstants.Spacing * 2, Height - ViewConstants.Spacing * 2, BoundsSpecified.All); ResumeLayout(true); }
private void RemoveLeftSide() { if (LeftSide != null) { LeftSide.Parent = null; LeftSide.Dispose(); LeftSide = null; var bounds = RootControl.Bounds; bounds.X -= Renderer.SideTabHeight; bounds.Width += Renderer.SideTabHeight; RootControl.Bounds = bounds; var hcs = Width - ViewConstants.Spacing * 2; if (RightSide != null) { hcs -= Renderer.SideTabHeight; } if (TopSide != null) { var w = TopSide.Width; var len = TopSide.OptimalLength; if (w >= len) { TopSide.Left = ViewConstants.Spacing; } else { if (len > hcs) { len = hcs; } TopSide.SetBounds( ViewConstants.Spacing, 0, len, Renderer.SideTabHeight, BoundsSpecified.X | BoundsSpecified.Width); } } if (BottomSide != null) { var w = BottomSide.Height; var len = BottomSide.OptimalLength; if (w >= len) { BottomSide.Left = ViewConstants.Spacing; } else { if (len > hcs) { len = hcs; } BottomSide.SetBounds( ViewConstants.Spacing, 0, len, Renderer.SideTabHeight, BoundsSpecified.X | BoundsSpecified.Width); } } } }
/// <summary> /// Releases the unmanaged resources used by the <see cref="T:System.Windows.Forms.Control"/> and its child controls and optionally releases the managed resources. /// </summary> /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param> protected override void Dispose(bool disposing) { lock (_grids) { _grids.Remove(this); } if (disposing) { _dockMarkers.Dispose(); if (LeftSide != null) { LeftSide.Dispose(); LeftSide = null; } if (TopSide != null) { TopSide.Dispose(); TopSide = null; } if (RightSide != null) { RightSide.Dispose(); RightSide = null; } if (BottomSide != null) { BottomSide.Dispose(); BottomSide = null; } if (PopupsStack != null) { PopupsStack.Dispose(); PopupsStack = null; } RootControl = null; _floatingViewForms.Clear(); } base.Dispose(disposing); }