protected virtual void ExecuteExpandFinalizations()
        {
            this.IsAnimating           = false;
            this.isAnimatingFromMethod = false;
            CollapsiblePanelControlsContainer controlsContainer = this.ownerControl.ControlsContainer;

            if (!this.ExpandDirectionIsHorizontal())
            {
                controlsContainer.VerticalScrollBarState = this.savedVerticalScrollState;
            }
            else
            {
                controlsContainer.HorizontalScrollBarState = this.savedHorizontalScrollState;
            }
            switch (this.AnimationType)
            {
            case CollapsiblePanelAnimationType.Reveal:
                this.ownerControl.ControlsContainer.ResumeChildControlsLayout(true);
                break;

            case CollapsiblePanelAnimationType.Slide:
                if (this.LayoutElement.Image == null)
                {
                    break;
                }
                this.LayoutElement.Image.Dispose();
                this.LayoutElement.Image = (Image)null;
                break;

            default:
                throw new InvalidOperationException(string.Format(RadCollapsiblePanelElement.NotSupportedEnumFormatString, (object)this.AnimationType));
            }
        }
 protected virtual void InitializeInternalContainer()
 {
     this.SuspendLayout();
     this.controlsContainer      = this.CreateControlsContainer();
     this.controlsContainer.Name = "CollapsiblePanelControlsContainer";
     this.controlsContainer.RootElement.StretchHorizontally = true;
     this.controlsContainer.RootElement.StretchVertically   = true;
     this.controlsContainer.RootElement.EnableElementShadow = false;
     (this.Controls as RadCollapsiblePanelControlsCollection).AddInternal((Control)this.controlsContainer);
     this.ResumeLayout(true);
 }
        protected virtual void ExecuteCollapsePreparations()
        {
            this.IsAnimating           = true;
            this.isAnimatingFromMethod = true;
            CollapsiblePanelControlsContainer controlsContainer = this.ownerControl.ControlsContainer;

            if (!this.ExpandDirectionIsHorizontal())
            {
                if (!controlsContainer.VerticalScrollbar.Visible)
                {
                    this.savedVerticalScrollState            = controlsContainer.VerticalScrollBarState;
                    controlsContainer.VerticalScrollBarState = ScrollState.AlwaysHide;
                }
            }
            else if (!controlsContainer.HorizontalScrollbar.Visible)
            {
                this.savedHorizontalScrollState            = controlsContainer.HorizontalScrollBarState;
                controlsContainer.HorizontalScrollBarState = ScrollState.AlwaysHide;
            }
            switch (this.AnimationType)
            {
            case CollapsiblePanelAnimationType.Reveal:
                this.ownerControl.ControlsContainer.SuspendChildControlsLayout();
                break;

            case CollapsiblePanelAnimationType.Slide:
                if (this.ownerControl.ControlsContainer.Width > 0 && this.ownerControl.ControlsContainer.Height > 0)
                {
                    this.LayoutElement.Image = (Image)this.ownerControl.ControlsContainer.ToBitmap();
                }
                this.suspendLayoutElementSynchronization = true;
                if (!this.ExpandDirectionIsHorizontal())
                {
                    this.ownerControl.ControlsContainer.Height = 0;
                    break;
                }
                this.ownerControl.ControlsContainer.Width = 0;
                break;

            default:
                throw new InvalidOperationException(string.Format(RadCollapsiblePanelElement.NotSupportedEnumFormatString, (object)this.AnimationType));
            }
        }