///<summary>
        /// Constructor for <see cref="CollapsiblePanelManager"/>
        ///</summary>
        ///<param name="collapsiblePanel"></param>
        ///<param name="controlFactory"></param>
        public CollapsiblePanelManager(ICollapsiblePanel collapsiblePanel, IControlFactory controlFactory)
        {
            _controlFactory = controlFactory;
            _collapsiblePanel = collapsiblePanel;
            _collapseButton = _controlFactory.CreateButtonCollapsibleStyle();


            _collapseButton.Click += delegate { Collapsed = !Collapsed; };
            _pinLabel = controlFactory.CreateLabelPinOffStyle();
            _pinLabel.Click += delegate { Pinned = !Pinned; };

            IPanel buttonPanel = _controlFactory.CreatePanel();
            BorderLayoutManager buttonLayoutManager =
                _controlFactory.CreateBorderLayoutManager(buttonPanel);
            buttonPanel.Height = _collapseButton.Height;

            buttonLayoutManager.AddControl(_collapseButton, BorderLayoutManager.Position.Centre);
            buttonLayoutManager.AddControl(_pinLabel, BorderLayoutManager.Position.East);

            _layoutManager = _controlFactory.CreateBorderLayoutManager(collapsiblePanel);
            _layoutManager.AddControl(buttonPanel, BorderLayoutManager.Position.North);


            _collapseButton.BackColor = System.Drawing.Color.Transparent;
            _collapseButton.ForeColor = System.Drawing.Color.Transparent;
        }
Beispiel #2
0
        ///<summary>
        /// Constructor for <see cref="CollapsiblePanelManager"/>
        ///</summary>
        ///<param name="collapsiblePanel"></param>
        ///<param name="controlFactory"></param>
        public CollapsiblePanelManager(ICollapsiblePanel collapsiblePanel, IControlFactory controlFactory)
        {
            _controlFactory   = controlFactory;
            _collapsiblePanel = collapsiblePanel;
            _collapseButton   = _controlFactory.CreateButtonCollapsibleStyle();


            _collapseButton.Click += delegate { Collapsed = !Collapsed; };
            _pinLabel              = controlFactory.CreateLabelPinOffStyle();
            _pinLabel.Click       += delegate { Pinned = !Pinned; };

            IPanel buttonPanel = _controlFactory.CreatePanel();
            BorderLayoutManager buttonLayoutManager =
                _controlFactory.CreateBorderLayoutManager(buttonPanel);

            buttonPanel.Height = _collapseButton.Height;

            buttonLayoutManager.AddControl(_collapseButton, BorderLayoutManager.Position.Centre);
            buttonLayoutManager.AddControl(_pinLabel, BorderLayoutManager.Position.East);

            _layoutManager = _controlFactory.CreateBorderLayoutManager(collapsiblePanel);
            _layoutManager.AddControl(buttonPanel, BorderLayoutManager.Position.North);


            _collapseButton.BackColor = System.Drawing.Color.Transparent;
            _collapseButton.ForeColor = System.Drawing.Color.Transparent;
        }