ScreenToGif.Modern.EditFrames C# (CSharp) Method

EditFrames() private method

Constructor of the Frame Edit Page.
private EditFrames ( ) : void
return void
        private void EditFrames()
        {
            this.Cursor = Cursors.WaitCursor;

            _listFramesEdit = new List<string>();
            _listFramesUndo = new List<string>();

            int frameActual = 0;
            foreach (var frame in _listFrames)
            {
                File.Copy(frame, _pathTemp + String.Format(@"Edit\{0}.bmp", frameActual));
                _listFramesEdit.Add(_pathTemp + String.Format(@"Edit\{0}.bmp", frameActual));

                File.Copy(frame, _pathTemp + String.Format(@"Undo\{0}.bmp", frameActual));
                _listFramesUndo.Add(_pathTemp + String.Format(@"Undo\{0}.bmp", frameActual));

                frameActual++;
            }

            //Copies the listDelay to all the lists
            _listDelayEdit = new List<int>(_listDelay);
            _listDelayUndo = new List<int>(_listDelay);

            Application.DoEvents();

            panelEdit.Visible = true;

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

            this.MinimumSize = new Size(100, 100);
            this.Text = Resources.Title_EditorFrame + trackBar.Value + " - " + (_listFramesEdit.Count - 1);

            ResizeFormToImage(); //Resizes the form to hold the image.

            pictureBitmap.Image = _listFramesEdit.First().From();

            #region Preview Config.

            _timerPlayPreview.Interval = _listDelayEdit[trackBar.Value];

            #endregion

            #region Delay Properties

            //Sets the initial location
            _lastPosition = lblDelay.Location;
            _delay = _listDelayEdit[0];
            lblDelay.Text = _delay + " ms";

            #endregion

            MainSplit.Panel1Collapsed = true;

            #region Add List of frames to the TreeView

            if (_listFramesEdit != null)
            {
                tvFrames.UpdateListFrames(_listFramesEdit.Count, _parentNodeLabel);
            }

            Application.DoEvents();

            #endregion

            if (String.IsNullOrEmpty(ArgumentUtil.FileName))
            {
                this.Invoke((Action)(() => Processing.Page.Dispose()));
            }

            GC.Collect(3);

            this.Cursor = Cursors.Default;
        }
Modern