Beispiel #1
0
        private void ReadFiles()
        {
            if (string.IsNullOrEmpty(txtOutputFolder.Text.Trim()) || !Directory.Exists(txtOutputFolder.Text.Trim()))
            {
                return;
            }

            lstFiles.BeginUpdate();
            lstFiles.Items.Clear();

            string outputDir       = txtOutputFolder.Text.Trim();
            int    outputDirLength = txtOutputFolder.Text.Trim().Length;

            FileSystemEnumerator enumerator = new FileSystemEnumerator(txtOutputFolder.Text.Trim(), "*.*", true);

            foreach (FileInfo fi in enumerator.Matches())
            {
                string thisFile = fi.FullName;
                if ((IsIgnorable(thisFile)))
                {
                    continue;
                }
                FileInfoEx   thisInfo = new FileInfoEx(thisFile, outputDirLength);
                ListViewItem thisItem = new ListViewItem(thisInfo.RelativeName, GetImageIndex(thisInfo.FileInfo.Extension));
                thisItem.SubItems.Add(thisInfo.FileVersion);
                thisItem.SubItems.Add(thisInfo.FileInfo.Length.ToString(CultureInfo.InvariantCulture));
                thisItem.SubItems.Add(thisInfo.FileInfo.LastWriteTime.ToString(CultureInfo.InvariantCulture));
                thisItem.SubItems.Add(thisInfo.Hash);
                thisItem.Checked = (!Settings.Default.IgnoreFiles.Contains(thisInfo.FileInfo.Name));
                thisItem.Tag     = thisInfo;
                lstFiles.Items.Add(thisItem);
            }
            lstFiles.EndUpdate();
        }
Beispiel #2
0
        private void ReadFiles()
        {
            if (!string.IsNullOrEmpty(txtOutputFolder.Text.Trim()) && Directory.Exists(txtOutputFolder.Text.Trim()))
            {
                ListViewItem thisItem = null;
                FileInfoEx   thisInfo = null;

                lstFiles.BeginUpdate();
                lstFiles.Items.Clear();
                var enumerator = new FindFiles.FileSystemEnumerator(txtOutputFolder.Text.Trim(), "*.*", true);
                foreach (FileInfo fi in enumerator.Matches())
                {
                    string thisFile = fi.FullName;
                    if ((!IsIgnorable(thisFile)))
                    {
                        thisInfo = new FileInfoEx(thisFile);
                        var _with4 = thisInfo;
                        thisItem = new ListViewItem(_with4.FileInfo.Name, GetImageIndex(_with4.FileInfo.Extension));
                        thisItem.SubItems.Add(_with4.FileVersion);
                        thisItem.SubItems.Add(_with4.FileInfo.Length.ToString());
                        thisItem.SubItems.Add(_with4.FileInfo.LastWriteTime.ToString());
                        thisItem.SubItems.Add(_with4.Hash);
                        thisItem.Checked = (!Settings.Default.IgnoreFiles.Contains(_with4.FileInfo.Name));
                        thisItem.Tag     = thisInfo;
                        lstFiles.Items.Add(thisItem);
                    }
                }
                lstFiles.EndUpdate();
            }
        }
Beispiel #3
0
        private void ReadFiles()
        {
            string outputDir = txtOutputFolder.Text.Trim();

            if (string.IsNullOrEmpty(outputDir) || !Directory.Exists(outputDir))
            {
                return;
            }

            if (!outputDir.EndsWith("\\"))
            {
                outputDir += "\\";
            }

            lstFiles.BeginUpdate();
            lstFiles.Items.Clear();

            foreach (string path in Directory.GetFiles(outputDir, "*.*", SearchOption.AllDirectories))
            {
                var    fi       = new FileInfo(path);
                var    outputDI = new DirectoryInfo(outputDir);
                string filePath = fi.FullName;

                FileInfoEx fileInfo = new FileInfoEx(filePath, outputDI.FullName.Length);

                if ((IsIgnorable(filePath) || IsIgnorableFile(fileInfo.RelativeName)))
                {
                    continue;
                }

                ListViewItem item = new ListViewItem(fileInfo.RelativeName, GetImageIndex(fileInfo.FileInfo.Extension));
                item.SubItems.Add(fileInfo.FileVersion);
                item.SubItems.Add(fileInfo.FileInfo.Length.ToString(CultureInfo.InvariantCulture));
                item.SubItems.Add(fileInfo.FileInfo.LastWriteTime.ToString(CultureInfo.InvariantCulture));
                item.SubItems.Add(fileInfo.Hash);
                //item.Checked = (!Settings.Default.IgnoreFiles.Contains(fileInfo.FileInfo.Name));
                //item.Checked = !IsIgnorableFile(fileInfo.RelativeName);
                item.Tag = fileInfo;
                lstFiles.Items.Add(item);
            }

            lstFiles.EndUpdate();
        }
Beispiel #4
0
        private void ReadFiles()
        {
            string outputDir = txtOutputFolder.Text.Trim();

            if (string.IsNullOrEmpty(outputDir) || !Directory.Exists(outputDir))
            {
                return;
            }

            if (!outputDir.EndsWith("\\"))
            {
                outputDir += "\\";
            }

            lstFiles.BeginUpdate();
            lstFiles.Items.Clear();

            FileSystemEnumerator enumerator = new FileSystemEnumerator(outputDir, "*.*", true);

            foreach (FileInfo fi in enumerator.Matches())
            {
                string filePath = fi.FullName;

                if ((IsIgnorable(filePath)))
                {
                    continue;
                }

                FileInfoEx fileInfo = new FileInfoEx(filePath, outputDir.Length);

                ListViewItem item = new ListViewItem(fileInfo.RelativeName, GetImageIndex(fileInfo.FileInfo.Extension));
                item.SubItems.Add(fileInfo.FileVersion);
                item.SubItems.Add(fileInfo.FileInfo.Length.ToString(CultureInfo.InvariantCulture));
                item.SubItems.Add(fileInfo.FileInfo.LastWriteTime.ToString(CultureInfo.InvariantCulture));
                item.SubItems.Add(fileInfo.Hash);
                item.Checked = (!Settings.Default.IgnoreFiles.Contains(fileInfo.FileInfo.Name));
                item.Tag     = fileInfo;
                lstFiles.Items.Add(item);
            }

            lstFiles.EndUpdate();
        }