private void SetPanelNodeState(IDockPanel pDockPanel, PanelNodeState panelNodeState)//设置其所辖的面板节点状态并激发相应事件(将在两个Show(...)和OnFormClosing(...)函数中被调用)
        {
            if (pDockPanel == null)
            {
                return;
            }
            //
            switch (panelNodeState)
            {
            case PanelNodeState.eShow:
                switch (pDockPanel.eDockPanelStyle)
                {
                case DockPanelStyle.eDockPanel:
                    DockPanel dockPanel = pDockPanel as DockPanel;
                    if (dockPanel != null)
                    {
                        ((ISetPanelNodeStateHelper)dockPanel).SetPanelNodeState(PanelNodeState.eShow);
                    }
                    break;

                case DockPanelStyle.eDockPanelContainer:
                    DockPanelContainer dockPanelContainer = pDockPanel as DockPanelContainer;
                    if (dockPanelContainer != null)
                    {
                        ((ISetPanelNodeStateHelper)dockPanelContainer).SetPanelNodeState(PanelNodeState.eShow);
                    }
                    break;

                default:
                    break;
                }
                break;

            case PanelNodeState.eClose:
                switch (pDockPanel.eDockPanelStyle)
                {
                case DockPanelStyle.eDockPanel:
                    DockPanel dockPanel = pDockPanel as DockPanel;
                    if (dockPanel != null)
                    {
                        ((ISetPanelNodeStateHelper)dockPanel).SetPanelNodeState(PanelNodeState.eClose);
                    }
                    break;

                case DockPanelStyle.eDockPanelContainer:
                    DockPanelContainer dockPanelContainer = pDockPanel as DockPanelContainer;
                    if (dockPanelContainer != null)
                    {
                        ((ISetPanelNodeStateHelper)dockPanelContainer).SetPanelNodeState(PanelNodeState.eClose);
                    }
                    break;

                default:
                    break;
                }
                break;
            }
        }
Beispiel #2
0
        void ISetPanelNodeStateHelper.SetPanelNodeState(PanelNodeState panelNodeState)//设置面板节点状态并激发相应事件
        {
            if (this.m_ePanelNodeState == panelNodeState)
            {
                return;
            }
            PanelNodeStateChangedEventArgs e = new PanelNodeStateChangedEventArgs(this.m_ePanelNodeState, panelNodeState, this);

            this.m_ePanelNodeState = panelNodeState;
            this.OnPanelNodeStateChanged(e);
            //
            switch (this.m_ePanelNodeState)
            {
            case PanelNodeState.eShow:
                this.OnOpened(new EventArgs());
                break;

            case PanelNodeState.eClose:
            case PanelNodeState.eRemove:
                this.OnClosed(new EventArgs());
                break;
            }
        }
 public PanelNodeStateChangedEventArgs(PanelNodeState oldValue, PanelNodeState newValue, object other)
 {
     this._OldValue = oldValue;
     this._NewValue = newValue;
     this._Other    = other;
 }
 public PanelNodeStateChangedEventArgs(PanelNodeState oldValue, PanelNodeState newValue)
 {
     this._OldValue = oldValue;
     this._NewValue = newValue;
 }