ZForge.Controls.ExplorerBar.Expando.OnSizeChanged C# (CSharp) Method

OnSizeChanged() protected method

Raises the SizeChanged event
protected OnSizeChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data
return void
        protected override void OnSizeChanged(EventArgs e)
        {
            base.OnSizeChanged(e);

            // if we are currently animating and the width of the
            // group has changed (eg. due to a scrollbar on the
            // TaskPane appearing/disappearing), get a new image
            // to use for the animation. (if we were to continue to
            // use the old image it would be shrunk or stretched making
            // the animation look wierd)
            if (this.Animating && this.Width != this.oldWidth)
            {
                // if the width or height of the group is zero it probably
                // means that our parent form has been minimized so we should
                // immediately stop animating
                if (this.Width == 0)
                {
                    this.animationHelper.StopAnimation();
                }
                else
                {
                    this.oldWidth = this.Width;

                    if (this.AnimationImage != null)
                    {
                        // get the new animationImage
                        this.animationImage = this.GetFadeAnimationImage();
                    }
                }
            }
                // check if the width has changed.  if it has re-layout
                // the group so that the TaskItems can resize themselves
                // if neccessary
            else if (this.Width != this.oldWidth)
            {
                this.oldWidth = this.Width;

                this.DoLayout();
            }
        }