Example #1
0
 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);
 }
Example #2
0
        private void KillBottomSide()
        {
            if (BottomSide != null)
            {
                BottomSide.Parent = null;
                BottomSide.Dispose();
                BottomSide          = null;
                RootControl.Height += Renderer.SideTabHeight;

                var vcs = Height - Renderer.SideTabHeight * 2;
                if (BottomSide != null)
                {
                    vcs -= Renderer.SideTabHeight;
                }
                if (LeftSide != null)
                {
                    var h   = LeftSide.Height;
                    var len = LeftSide.OptimalLength;
                    if (h < len)
                    {
                        if (len > vcs)
                        {
                            len = vcs;
                        }
                        LeftSide.Height = len;
                    }
                }
                if (RightSide != null)
                {
                    var h   = RightSide.Height;
                    var len = RightSide.OptimalLength;
                    if (h < len)
                    {
                        if (len > vcs)
                        {
                            len = vcs;
                        }
                        RightSide.Height = len;
                    }
                }
            }
        }
Example #3
0
 /// <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);
 }