private void RemoveTopSide() { if (_top != null) { _top.Parent = null; _top.Dispose(); _top = null; var bounds = _rootControl.Bounds; bounds.Y -= Renderer.SideTabHeight; bounds.Height += Renderer.SideTabHeight; _rootControl.Bounds = bounds; var vcs = Height - Renderer.SideTabHeight * 2; if (_bottom != null) { vcs -= Renderer.SideTabHeight; } if (_left != null) { var h = _left.Height; var len = _left.OptimalLength; if (h >= len) { _left.Top = ViewConstants.Spacing; } else { if (len > vcs) { len = vcs; } _left.SetBounds( 0, ViewConstants.Spacing, Renderer.SideTabHeight, len, BoundsSpecified.Y | BoundsSpecified.Height); } } if (_right != null) { var h = _right.Height; var len = _right.OptimalLength; if (h >= len) { _right.Top = ViewConstants.Spacing; } else { if (len > vcs) { len = vcs; } _right.SetBounds( 0, ViewConstants.Spacing, Renderer.SideTabHeight, len, BoundsSpecified.Y | BoundsSpecified.Height); } } } }
private void RemoveLeftSide() { if (_left != null) { _left.Parent = null; _left.Dispose(); _left = null; var bounds = _rootControl.Bounds; bounds.X -= Renderer.SideTabHeight; bounds.Width += Renderer.SideTabHeight; _rootControl.Bounds = bounds; var hcs = Width - ViewConstants.Spacing * 2; if (_right != null) { hcs -= Renderer.SideTabHeight; } if (_top != null) { var w = _top.Width; var len = _top.OptimalLength; if (w >= len) { _top.Left = ViewConstants.Spacing; } else { if (len > hcs) { len = hcs; } _top.SetBounds( ViewConstants.Spacing, 0, len, Renderer.SideTabHeight, BoundsSpecified.X | BoundsSpecified.Width); } } if (_bottom != null) { var w = _bottom.Height; var len = _bottom.OptimalLength; if (w >= len) { _bottom.Left = ViewConstants.Spacing; } else { if (len > hcs) { len = hcs; } _bottom.SetBounds( ViewConstants.Spacing, 0, len, Renderer.SideTabHeight, BoundsSpecified.X | BoundsSpecified.Width); } } } }