ARCed.Database.Animations.AnimationMainForm.numericUpDownFrames_ValueChanged C# (CSharp) Method

numericUpDownFrames_ValueChanged() private method

private numericUpDownFrames_ValueChanged ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void numericUpDownFrames_ValueChanged(object sender, EventArgs e)
        {
            if (!SuppressEvents)
            {
                var frames = (int)this.numericUpDownFrames.Value;
                if (this._animation.frames.Count > frames)
                {
                    for (int i = this._animation.frames.Count; i > frames; i--)
                        this._animation.frames.RemoveAt(i - 1);
                }
                else if (this._animation.frames.Count < frames)
                {
                    for (int i = this._animation.frames.Count; i < frames; i++)
                        this._animation.frames.Add(new Animation.Frame());
                }
                this._animation.frame_max = frames;
                this.RefreshFrameList();
            }
        }