ComponentFactory.Krypton.Docking.KryptonAutoHiddenSlidePanel.KryptonAutoHiddenSlidePanel C# (CSharp) Method

KryptonAutoHiddenSlidePanel() public method

Initialize a new instance of the KryptonAutoHiddenSlidePanel class.
public KryptonAutoHiddenSlidePanel ( Control control, DockingEdge edge, KryptonAutoHiddenPanel panel ) : System
control System.Windows.Forms.Control Reference to control that is being managed.
edge DockingEdge Docking edge being managed.
panel KryptonAutoHiddenPanel Reference to auto hidden panel for this edge.
return System
        public KryptonAutoHiddenSlidePanel(Control control, DockingEdge edge, KryptonAutoHiddenPanel panel)
        {
            _control = control;
            _edge = edge;
            _panel = panel;
            _state = DockingAutoHiddenShowState.Hidden;
            _checkMakeHidden = new EventHandler(OnCheckMakeHidden);

            // We need to a timer to automate sliding in and out
            _slideTimer = new Timer();
            _slideTimer.Interval = SLIDE_INTERVAL;
            _slideTimer.Tick += new EventHandler(OnSlideTimerTick);

            // Timer used to delay between notification of need to slide inwards and performing actual slide
            _dismissTimer = new Timer();
            _dismissTimer.Interval = DISMISS_INTERVAL;
            _dismissTimer.Tick += new EventHandler(OnDismissTimerTick);
            _dismissRunning = false;

            // Create inner panel that holds the actual dockspace and separator
            _dockspaceSlide = new KryptonDockspaceSlide();
            _dockspaceSlide.Dock = DockStyle.Fill;
            _dockspaceSlide.AutoHiddenHost = true;
            _dockspaceSlide.PageCloseClicked += new EventHandler<UniqueNameEventArgs>(OnDockspacePageCloseClicked);
            _dockspaceSlide.PageAutoHiddenClicked += new EventHandler<UniqueNameEventArgs>(OnDockspacePageAutoHiddenClicked);
            _dockspaceSlide.PageDropDownClicked += new EventHandler<CancelDropDownEventArgs>(OnDockspacePageDropDownClicked);

            _separator = new KryptonDockspaceSeparator(edge, true);
            _separator.SplitterMoving += new SplitterCancelEventHandler(OnDockspaceSeparatorMoving);
            _separator.SplitterMoved += new SplitterEventHandler(OnDockspaceSeparatorMoved);
            _separator.SplitterMoveRect += new EventHandler<SplitterMoveRectMenuArgs>(OnDockspaceSeparatorMoveRect);

            _inner = new KryptonPanel();
            _inner.Controls.AddRange(new Control[] { _dockspaceSlide, _separator });
            Controls.Add(_inner);

            // Do not show ourself until we are needed
            Visible = false;

            // Add a Button that is not showing and used to push focus away from the dockspace
            _dummyTarget = new Button();
            _dummyTarget.Location = new Point(-200, -200);
            _dummyTarget.Size = new Size(100, 100);
            Controls.Add(_dummyTarget);

            // Add ourself into the target control for docking
            control.SizeChanged += new EventHandler(OnControlSizeChanged);
            control.Controls.Add(this);

            // Need to peek at windows messages so we can determine if mouse is over the slide out panel
            Application.AddMessageFilter(this);
        }