ARCed.UI.DockPane.RefreshStateChange C# (CSharp) Method

RefreshStateChange() private method

private RefreshStateChange ( INestedPanesContainer oldContainer, DockState oldDockState ) : void
oldContainer INestedPanesContainer
oldDockState DockState
return void
        private void RefreshStateChange(INestedPanesContainer oldContainer, DockState oldDockState)
        {
            lock (this)
            {
                if (this.IsRefreshStateChangeSuspended)
                    return;

                this.SuspendRefreshStateChange();
            }

            this.DockPanel.SuspendLayout(true);

            IDockContent contentFocused = this.GetFocusedContent();
            if (contentFocused != null)
                this.DockPanel.SaveFocus();
            this.SetParent();

            if (this.ActiveContent != null)
                this.ActiveContent.DockHandler.SetDockState(this.ActiveContent.DockHandler.IsHidden, this.DockState, this.ActiveContent.DockHandler.Pane);
            foreach (IDockContent content in this.Contents)
            {
                if (content.DockHandler.Pane == this)
                    content.DockHandler.SetDockState(content.DockHandler.IsHidden, this.DockState, content.DockHandler.Pane);
            }

            if (oldContainer != null)
            {
                var oldContainerControl = (Control)oldContainer;
                if (oldContainer.DockState == oldDockState && !oldContainerControl.IsDisposed)
                    oldContainerControl.PerformLayout();
            }
            if (DockHelper.IsDockStateAutoHide(oldDockState))
                this.DockPanel.RefreshActiveAutoHideContent();

            if (this.NestedPanesContainer.DockState == this.DockState)
                ((Control)this.NestedPanesContainer).PerformLayout();
            if (DockHelper.IsDockStateAutoHide(this.DockState))
                this.DockPanel.RefreshActiveAutoHideContent();

            if (DockHelper.IsDockStateAutoHide(oldDockState) ||
                DockHelper.IsDockStateAutoHide(this.DockState))
            {
                this.DockPanel.RefreshAutoHideStrip();
                this.DockPanel.PerformLayout();
            }

            this.ResumeRefreshStateChange();

            if (contentFocused != null)
                contentFocused.DockHandler.Activate();

            this.DockPanel.ResumeLayout(true, true);

            if (oldDockState != this.DockState)
                this.OnDockStateChanged(EventArgs.Empty);
        }