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 RemoveRightSide() { if (RightSide != null) { RightSide.Parent = null; RightSide.Dispose(); RightSide = null; RootControl.Width += Renderer.SideTabHeight; var hcs = Width - ViewConstants.Spacing * 2; if (LeftSide != null) { hcs -= Renderer.SideTabHeight; } if (TopSide != null) { var w = TopSide.Width; var len = TopSide.OptimalLength; if (w < len) { if (len > hcs) { len = hcs; } TopSide.Width = len; } } if (BottomSide != null) { var w = BottomSide.Height; var len = BottomSide.OptimalLength; if (w < len) { if (len > hcs) { len = hcs; } BottomSide.Width = len; } } } }
/// <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); }