I have extended the standard FileSystemWatcher class by adding a string property (fileToTest), now i need to extend also the FileSystemEventArgs to add this property how can i do this ?
my extend FileSystemWatcher :
class AleFileSystemWatcher : FileSystemWatcher
{
public string fileToTest { get; set; }
}
The FileSystemEventArgs fileToTest property should be the same of AleFileSystemWatcher fileToTest .
Can i do this ?
Personally, I wouldn’t extend the FileSystemWatcher, but have it as an instance variable in a class. You don’t really extend the functionality of the FileSystemWatcher in its main respect, but make use of its functionality (ie. listen for changed/created/whatever files and match those with the file you are looking for)