C# Class XDAFileWatcher.XDAFileWatcher

Inheritance: IDisposable
Mostrar archivo Open project: GridProtectionAlliance/openXDA Class Usage Examples

Private Properties

Property Type Description
BuildDestinationName string
BuildResultsXml System.Xml.XmlDocument
CreateAndValidateNewWatcher void
CreateNewWatcher void
CreateOutputPattern XDAFileWatcher.DestinationFilePattern[]
CreateStaticElements XDAFileWatcher.DestinationFilePattern[]
ExtractParms bool
GetNextElement string
LogPatternString void
OnCreated void
OnDeleted void
OnRenamed void
ProcessThisFilename bool
ProcessThisFolder bool
ReadConfigXml bool
TryConnectToFileShare bool
WatcherMonitorElapsed void
writeXml void

Public Methods

Method Description
Dispose ( ) : void

Releases all the resources used by the XDAFileWatcher object.

ProcessEvent ( string sourceFullPath, FileEventType eventType ) : void

ReadConfigFile ( string configurationFilePath ) : void

StartWatching ( ) : void
XDAFileWatcher ( ) : System

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the XDAFileWatcher object and optionally releases the managed resources.

Private Methods

Method Description
BuildDestinationName ( string sourceFullPath, DestinationFilePattern patternSet, bool isFolderPathPiece ) : string
BuildResultsXml ( string sourceFullPath, string destinationFullPath, System.DateTime startTime, System.TimeSpan duration ) : XmlDocument
CreateAndValidateNewWatcher ( ) : void
CreateNewWatcher ( ) : void

CreateOutputPattern ( string inPatternString ) : XDAFileWatcher.DestinationFilePattern[]

Parses the output file inPatternString from the destination parameter in each action tag

CreateStaticElements ( WatchFolder wf, DestinationFilePattern pattern ) : XDAFileWatcher.DestinationFilePattern[]

ExtractParms ( XmlDocument configXml, List watchFolders ) : bool

Loads all the configuration information for the XML file into public fields

GetNextElement ( string &inString, bool &isField ) : string

For parsing destination string within "WatchCreated" tag

LogPatternString ( DestinationFilePattern pattern, bool isFolderPathPiece, int folderID ) : void

OnCreated ( object source, FileSystemEventArgs e ) : void
OnDeleted ( object source, FileSystemEventArgs e ) : void
OnRenamed ( object source, FileSystemEventArgs e ) : void
ProcessThisFilename ( string filespec, WatchFolder f ) : bool

ProcessThisFolder ( string fileSpec, WatchFolder f ) : bool

Returns TRUE if actions in this folder should be processed

ReadConfigXml ( string configurationFileFullPath, List watchFolders ) : bool

Reads the XML file as an "XMLDocument"and calls "ExtractParms" to load them

TryConnectToFileShare ( FileShare share ) : bool
WatcherMonitorElapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void
writeXml ( XmlDocument xmlDoc, string destinationFullPath ) : void

Method Details

Dispose() public method

Releases all the resources used by the XDAFileWatcher object.
public Dispose ( ) : void
return void

Dispose() protected method

Releases the unmanaged resources used by the XDAFileWatcher object and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

ProcessEvent() public method

public ProcessEvent ( string sourceFullPath, FileEventType eventType ) : void
sourceFullPath string
eventType FileEventType
return void

ReadConfigFile() public method

public ReadConfigFile ( string configurationFilePath ) : void
configurationFilePath string
return void

StartWatching() public method

public StartWatching ( ) : void
return void

XDAFileWatcher() public method

public XDAFileWatcher ( ) : System
return System