ImageGlass.ImageBox.OnImageChanged C# (CSharp) Method

OnImageChanged() protected method

Raises the ImageChanged event.
protected OnImageChanged ( EventArgs e ) : void
e System.EventArgs /// The instance containing the event data. ///
return void
        protected virtual void OnImageChanged(EventArgs e)
        {
            EventHandler handler;

            DefineViewSize();
            IsAnimating = false;

            if (Image != null)
            {
                //try
                //{
                //    this.IsAnimating = ImageAnimator.CanAnimate(this.Image);
                //    if (this.IsAnimating)
                //    {
                //        ImageAnimator.Animate(this.Image, this.OnFrameChangedHandler);
                //    }
                //}
                //catch (ArgumentException)
                //{
                //    // probably a disposed image, ignore
                //}

                StartAnimating();
            }

            AdjustLayout();

            handler = ImageChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
ImageBox