Ejemplo n.º 1
0
        /// <summary>
        /// Distrugere
        /// </summary>
        public void Dispose()
        {
            if (_container != null)
            {
                _container.Resize    -= OnContainerResize;
                _container.MouseDown -= OnMouseDownInContainer;
                _container.MouseMove -= OnMouseMovedInContainer;
                _container.MouseUp   -= OnMouseUpInContainer;
            }

            if (_splitter != null)
            {
                _splitter.Dispose();
                _splitter = null;
            }

            if (_container != null)
            {
                _container = null;
            }

            if (_layout != null)
            {
                _layout.Dispose();
                _layout = null;
            }

            GC.SuppressFinalize(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Consturctor
        /// </summary>
        /// <param name="container">container</param>
        public DockPanelsResizer(Control container)
        {
            _layout = new DockPanelsLayout();
            _layout.UpdateLayoutRequested += new EventHandler(OnUpdateLayoutRequested);

            _container = container;

            _container.Resize    += OnContainerResize;
            _container.MouseDown += OnMouseDownInContainer;
            _container.MouseMove += OnMouseMovedInContainer;
            _container.MouseUp   += OnMouseUpInContainer;

            _splitter.FormBorderStyle     = FormBorderStyle.None;
            _splitter.MinimumSize         = new Size(1, 1);
            _splitter.Width               = 1;
            _splitter.ShowInTaskbar       = false;
            _splitter.TopMost             = true;
            _splitter.BackColor           = Color.DarkGray;
            _splitter.Opacity             = 0.90;
            _splitter.StartPosition       = FormStartPosition.Manual;
            _splitter.AutoScaleMode       = AutoScaleMode.None;
            _splitter.Margin              = new Padding();
            _splitter.AutoScaleDimensions = new SizeF(1, 1);
            _splitter.Bounds              = new Rectangle(0, 0, 2, 2);

            UpdatePanelsLayout();
        }