FileSystemEventHandler Delegate

FileSystemEventHandler Delegate

 

Represents the method that will handle the Changed, Created, or Deleted event of a FileSystemWatcher class.

Namespace:   System.IO
Assembly:  System (in System.dll)

public delegate void FileSystemEventHandler(
	Object^ sender,
	FileSystemEventArgs^ e
)

Parameters

sender
Type: System::Object^

The source of the event.

e
Type: System.IO::FileSystemEventArgs^

The FileSystemEventArgs that contains the event data.

When you create a FileSystemEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see Handling and Raising Events.

The following example shows how to create a FileSystemWatcher to monitor file changes (creates, deletes, renames, changes) occurring on a disk drive. The example also shows how to properly receive error notifications.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft