Public Member Functions | |
| delegate void | ScanCompleteEventHandler (object sender, System.IO.DirectoryInfo[] DirectoryList, System.IO.FileInfo[] FileList) |
| framework of the OnScanComplete event handler | |
| delegate void | DirectoryFoundEventHandler (object sender, System.IO.DirectoryInfo directory) |
| framework of the OnDirectoryFound event handler | |
| delegate void | FileFoundEventHandler (object sender, System.IO.FileInfo file) |
| framework of the OnFileFound event handler | |
| DirectoryScanner () | |
| Class constructor that inits all nesessary stuff. | |
| void | Start () |
| Start the scan process with the following options: -scans the current path -does not scan recursive. | |
| void | Start (System.Boolean Recursive) |
| Start the scan process with the following options: -scans the current path. | |
| void | Start (System.Boolean Recursive, System.String Path) |
| Start the scan process. | |
| void | Clear () |
| Clears all lists. | |
Public Attributes | |
| event ScanCompleteEventHandler | OnScanComplete |
| Event that is invoked if the scan process is complete. | |
| event DirectoryFoundEventHandler | OnDirectoryFound |
| Event that is invoked if the scan process is complete. | |
| event FileFoundEventHandler | OnFileFound |
| Event that is invoked if the scan process is complete. | |
Properties | |
| System.String | SearchPatternFiles |
| Returns or sets the search pattern expression for files. | |
| System.String | SearchPatternDirectories |
| Returns or sets the search pattern expression for directories. | |
| System.Boolean | Busy |
| Returns if this class instance is scanning or not. | |
| System.IO.DirectoryInfo[] | Directories |
| Sub-Directories that were found while the last scan. | |
| System.IO.FileInfo[] | Files |
| Files that were found while the last scan. | |
Class that scans a directory for files and sub-directories
Revision 1.1 2005/05/03 12:59:55 generalpd first import
Definition at line 62 of file clsDirectoryScanner.cs.
|
|
Class constructor that inits all nesessary stuff.
// Code example CSharp_ClassLib.Filesystem.DirectoryScanner m_oDirScanner = new CSharp_ClassLib.Filesystem.DirectoryScanner(); Definition at line 101 of file clsDirectoryScanner.cs. |
|
||||||||||||
|
Start the scan process.
// Code example int i = 0; // start the scan process and scans all sub-directories of C:\WINDOWS m_oDirScanner.Start(true, "C:\\WINDOWS"); Console.WriteLine("Directories:"); Console.WriteLine("-----------------"); for (i = 0; i < m_oDirScanner.Directories.GetLength(0); i++) // output all sub-directories that were found Console.WriteLine(m_oDirScanner.Directories[i].FullName); Console.WriteLine(""); Console.WriteLine("Files:"); Console.WriteLine("-----------"); for (i = 0; i < m_oDirScanner.Files.GetLength(0); i++) // output all files that were found Console.WriteLine(m_oDirScanner.Files[i].FullName);
Definition at line 348 of file clsDirectoryScanner.cs. |
|
|
Start the scan process with the following options: -scans the current path.
// Code example int i = 0; // start the scan process and scans all sub-directories m_oDirScanner.Start(true); Console.WriteLine("Directories:"); Console.WriteLine("-----------------"); for (i = 0; i < m_oDirScanner.Directories.GetLength(0); i++) // output all sub-directories that were found Console.WriteLine(m_oDirScanner.Directories[i].FullName); Console.WriteLine(""); Console.WriteLine("Files:"); Console.WriteLine("-----------"); for (i = 0; i < m_oDirScanner.Files.GetLength(0); i++) // output all files that were found Console.WriteLine(m_oDirScanner.Files[i].FullName);
Definition at line 307 of file clsDirectoryScanner.cs. |
|
|
Start the scan process with the following options: -scans the current path -does not scan recursive.
// Code example int i = 0; // start the scan process m_oDirScanner.Start(); Console.WriteLine("Directories:"); Console.WriteLine("------------------"); for (i = 0; i < m_oDirScanner.Directories.GetLength(0); i++) // output all sub-directories that were found Console.WriteLine(m_oDirScanner.Directories[i].FullName); Console.WriteLine(""); Console.WriteLine("Files:"); Console.WriteLine("-----------"); for (i = 0; i < m_oDirScanner.Files.GetLength(0); i++) // output all files that were found Console.WriteLine(m_oDirScanner.Files[i].FullName);
Definition at line 266 of file clsDirectoryScanner.cs. |
|
|
Returns if this class instance is scanning or not.
// Code example if ( m_oDirScanner.Busy ) Console.WriteLine("The directory scanner is still working!"); else Console.WriteLine("The scanner sleeps :D"); Definition at line 175 of file clsDirectoryScanner.cs. |
|
|
Sub-Directories that were found while the last scan.
// Code example int i = 0; for (i = 0; i < m_oDirScanner.Directories.GetLength(0); i++) // output all sub-directories that were found Console.WriteLine(m_oDirScanner.Directories[i].FullName); Definition at line 195 of file clsDirectoryScanner.cs. |
|
|
Files that were found while the last scan.
// Code example int i = 0; for (i = 0; i < m_oDirScanner.Files.GetLength(0); i++) // output all files that were found Console.WriteLine(m_oDirScanner.Files[i].FullName); Definition at line 223 of file clsDirectoryScanner.cs. |
|
|
Returns or sets the search pattern expression for directories.
// Code example // search only for directories that begins with "D" m_oDirScanner.SearchPatternDirectories = "D*"; Definition at line 153 of file clsDirectoryScanner.cs. |
|
|
Returns or sets the search pattern expression for files.
// Code example // search only for FLAC files m_oDirScanner.SearchPatternFiles = "*.flac"; Definition at line 130 of file clsDirectoryScanner.cs. |
1.4.1