CSharp_ClassLib.Filesystem.DirectoryScanner Class Reference

Directory scanner class. More...

List of all members.

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.


Detailed Description

Directory scanner class.

Class that scans a directory for files and sub-directories

Author:
generalpd
Version:
Revision
1.3
Date:
2005-04-18

Bug:
none

Todo:
none
Remarks:
Last changed by:
Author
generalpd
in revision
Revision
1.3
on
Date
2005/06/02 06:35:42
Note:
Log
clsDirectoryScanner.cs,v
Revision 1.3 2005/06/02 06:35:42 generalpd
Revision 1.2 2005/06/02 05:51:50 generalpd

Revision 1.1 2005/05/03 12:59:55 generalpd first import

Definition at line 62 of file clsDirectoryScanner.cs.


Constructor & Destructor Documentation

CSharp_ClassLib::Filesystem.DirectoryScanner::DirectoryScanner  ) 
 

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.


Member Function Documentation

void CSharp_ClassLib::Filesystem.DirectoryScanner::Start System.Boolean  Recursive,
System.String  Path
 

Start the scan process.

Parameters:
Recursive Scans the current directory recursive (true) or not (false)
Path The path that should be scanned
  // 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);

Exceptions:
System.IO.DirectoryNotFoundException The given Path was not found!

Definition at line 348 of file clsDirectoryScanner.cs.

void CSharp_ClassLib::Filesystem.DirectoryScanner::Start System.Boolean  Recursive  ) 
 

Start the scan process with the following options: -scans the current path.

Parameters:
Recursive Scans the current directory recursive (true) or not (false)
  // 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);

Exceptions:
System.IO.DirectoryNotFoundException The given Path was not found!

Definition at line 307 of file clsDirectoryScanner.cs.

void CSharp_ClassLib::Filesystem.DirectoryScanner::Start  ) 
 

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);

Exceptions:
System.IO.DirectoryNotFoundException The given Path was not found!

Definition at line 266 of file clsDirectoryScanner.cs.


Property Documentation

System Boolean CSharp_ClassLib::Filesystem.DirectoryScanner::Busy [get]
 

Returns if this class instance is scanning or not.

Returns:
true => is currently scanning (true); false => is currently not scanning
  // 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.

CSharp_ClassLib::Filesystem.DirectoryScanner::Directories [get]
 

Sub-Directories that were found while the last scan.

Returns:
All sub-directories that were found
  // 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.

CSharp_ClassLib::Filesystem.DirectoryScanner::Files [get]
 

Files that were found while the last scan.

Returns:
All files that were found
  // 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.

System String CSharp_ClassLib::Filesystem.DirectoryScanner::SearchPatternDirectories [get, set]
 

Returns or sets the search pattern expression for directories.

Parameters:
value The new expression
Returns:
The search pattern expression
  // Code example
 
  // search only for directories that begins with "D"
  m_oDirScanner.SearchPatternDirectories = "D*";

Definition at line 153 of file clsDirectoryScanner.cs.

System String CSharp_ClassLib::Filesystem.DirectoryScanner::SearchPatternFiles [get, set]
 

Returns or sets the search pattern expression for files.

Parameters:
value The new expression
Returns:
The search pattern expression
  // Code example
 
  // search only for FLAC files
  m_oDirScanner.SearchPatternFiles = "*.flac";

Definition at line 130 of file clsDirectoryScanner.cs.


The documentation for this class was generated from the following file:
Generated on Thu Jun 2 08:41:50 2005 for C# ClassLib by  doxygen 1.4.1