Exemplo n.º 1
0
        public Traverser(string RootFolderPath)
        {
            DirectoryInfo	RootInfo;

            RootInfo = new DirectoryInfo(RootFolderPath);
            this._rootFolder = new ScanFolder(RootInfo);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Make this generic
        /// </summary>
        /// <param name="Folder"></param>
        private void LaunchQuickViewPlus(ScanFolder Folder)
        {
            ProcessStartInfo	StartInfo;

            this.Cursor = Cursors.WaitCursor;
            try {
                this.Message(string.Format("Launching QuickViewPlus for {0}", Folder.FolderName));

                StartInfo = new ProcessStartInfo(@"C:\Program Files\Quick View Plus\Program\qvp32.exe",
                    string.Format("\"{0}\"", Folder.FolderPath));
                Process.Start(StartInfo);
            }
            catch (Exception E) {
                MessageBox.Show(this, E.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            finally {
                this.Cursor = Cursors.Default;
            }
        }
Exemplo n.º 3
0
        private void Explore(ScanFolder Folder)
        {
            ProcessStartInfo	StartInfo;

            this.Cursor = Cursors.WaitCursor;
            try {
                this.Message(string.Format("Exploring {0}", Folder.FolderName));

                StartInfo = new ProcessStartInfo("explorer.exe", string.Format("\"{0}\"", Folder.FolderPath));
                Process.Start(StartInfo);
            }
            catch (Exception E) {
                MessageBox.Show(this, E.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            finally {
                this.Cursor = Cursors.Default;
            }
        }
Exemplo n.º 4
0
        private TreeNode CreateTreeNode(ScanFolder Folder)
        {
            TreeNode NewNode;

            NewNode = new TreeNode(Folder.DisplayName);
            NewNode.Tag = Folder;	//Use the Tag to hold the node's ScanFolder

            return NewNode;
        }
Exemplo n.º 5
0
 //This is a node visitor
 private void ClearTotalVisitor(ScanFolder f)
 {
     f.ClearTotals();
 }
Exemplo n.º 6
0
 //This is a node visitor.  It is called once for each folder.
 private void SortFolder(ScanFolder f)
 {
     f.SubfolderMgr.Sort();
 }
Exemplo n.º 7
0
 //This is a node visitor.  It is called once for each folder.
 private void SetFiltersForFolderLike(ScanFolder f, object BMgr)
 {
     BucketManager Mgr = (BucketManager) BMgr;
     f.BucketMgr.SetFiltersLike(Mgr);
 }
Exemplo n.º 8
0
        public void Scan()
        {
            Traverser.Message(this.FolderPath);

            try {
                foreach (FileInfo f in this._dirInfo.GetFiles()) {
                    try {
                        this._mgr.AddFile(f.Extension, f.Length);
                    }
                    catch (System.IO.IOException E) {
                        Trace.WriteLine(string.Format("Ignoring error {0} in folder {1}",
                                                      E.Message, this._dirInfo.FullName));
                    }
                }
                foreach (DirectoryInfo d in this._dirInfo.GetDirectories()) {
                    try {
                        ScanFolder	NewFolder = new ScanFolder(d);
                        this._subfolderMgr.AddFolder(NewFolder);
                        NewFolder.Scan();
                        this._mgr.AddBuckets(NewFolder._mgr);
                    }
                    catch (System.IO.IOException E) {
                        Trace.WriteLine(string.Format("Ignoring error {0} in folder {1}",
                                                      E.Message, this._dirInfo.FullName));
                    }
                }
                //At this point the scan folder has two collections of things that can
                //and should be sorted; subfolders and buckets (containing file types).

                this._mgr.Sort();
                this._subfolderMgr.Sort();
            }
            catch (System.Exception E) {
                Trace.WriteLine(string.Format("Ignoring error {0} in folder {1}",
                                              E.ToString(), this._dirInfo.FullName));
            }
        }
Exemplo n.º 9
0
 public void AddFolder(ScanFolder f)
 {
     this._subfolders.Add(f);
 }