private void LoadFolder(string Path, TreeNode Parent)
        {
            Parent.Nodes.Clear();

            if (!Directory.Exists(Path))
                return;

            DirectoryInfo[] directories = new DirectoryInfo(Path).GetDirectories();

            foreach (DirectoryInfo folder in directories)
            {
                AddNewDirectoryTreeNode(Parent, folder);
            }

            if (pictureUpdater != null && pictureUpdater.IsAlive)
                pictureUpdater.Abort();

            pictureUpdater = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                lock (locker)
                {
                    this.listViewFiles.InvokeIfNecessary(() => this.imageList.Images.Clear());
                    this.listViewFiles.InvokeIfNecessary(() => this.listViewFiles.SuspendLayout());
                    this.listViewFiles.InvokeIfNecessary(() => this.listViewFiles.Items.Clear());

                    FileInfo[] fileInfos = new DirectoryInfo(Path).GetFiles("*.png");

                    foreach (FileInfo fileInfo in fileInfos)
                    {
                        Capture cap = new Capture(fileInfo.FullName);
                        this.AddNewCaptureListViewItem(cap);
                        cap.Image.Dispose();
                    }

                    this.listViewFiles.InvokeIfNecessary(() => this.listViewFiles.ResumeLayout(false));
                }
            });

            pictureUpdater.Start();
        }
 private void AddNewCaptureListViewItem(Capture cap)
 {
     ListViewItem item = new ListViewItem();
     item.Tag = cap;
     item.Text = cap.Name;
     item.ToolTipText = cap.FilePath;
     int index = 0;
     this.listViewFiles.InvokeIfNecessary(() => {
         if (!this.imageList.Images.ContainsKey(cap.Name))
             this.imageList.Images.Add(cap.Name, cap.Image);
         
         index = this.imageList.Images.IndexOfKey(cap.Name);
     });
     item.ImageIndex = index;
     this.listViewFiles.InvokeIfNecessary(() => this.listViewFiles.Items.Add(item));
 }