Bewerken

Delen via


FileSystemWatcher.OnRenamed(RenamedEventArgs) Method

Definition

Raises the Renamed event.

protected:
 void OnRenamed(System::IO::RenamedEventArgs ^ e);
protected void OnRenamed (System.IO.RenamedEventArgs e);
member this.OnRenamed : System.IO.RenamedEventArgs -> unit
Protected Sub OnRenamed (e As RenamedEventArgs)

Parameters

e
RenamedEventArgs

A RenamedEventArgs that contains the event data.

Remarks

OnRenamed is called when a file or directory within the directory being monitored is renamed. Its RenamedEventArgs argument contains information about the renaming operation, such as the type of change, the old and new path, and the old and new name. Note that its Name property may be null for renamed events if the FileSystemWatcher does not get matching old and new name events from the operating system.

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

Notes to Inheritors

When overriding OnRenamed(RenamedEventArgs) in a derived class, be sure to call the base class's OnRenamed(RenamedEventArgs) method.

Applies to

See also