ScreenToGif.Modern.con_deleteAfter_Click C# (CSharp) Method

con_deleteAfter_Click() private method

private con_deleteAfter_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void con_deleteAfter_Click(object sender, EventArgs e)
        {
            if (_listFramesEdit.Count <= 1) return;

            ResetUndoProp();

            int countList = _listFramesEdit.Count - 1; //So we have a fixed value
            int removeCount = 0;

            for (int i = countList; i > trackBar.Value; i--) //from the end to the middle
            {
                File.Delete(_listFramesEdit[i]);
                _listFramesEdit.RemoveAt(i);
                _listDelayEdit.RemoveAt(i);
                removeCount++;
            }

            trackBar.Maximum = _listFramesEdit.Count - 1;
            trackBar.Value = _listFramesEdit.Count - 1;

            pictureBitmap.Image = _listFramesEdit[trackBar.Value].From();
            this.Text = Resources.Title_EditorFrame + trackBar.Value + " - " + (_listFramesEdit.Count - 1);

            tvFrames.Remove(removeCount);
            DelayUpdate();
            GC.Collect();
        }
Modern