FileSystemLinkWatcher

Namespace: TagBites.IO
Assembly: TagBites.IO.dll

Provides the base class from which the classes that represent mechanism for listening to the file system change notifications and raises events when a directory, or file in directory changes are derived.

public abstract class FileSystemLinkWatcher : TagBites.IO.IFileSystemLinkWatcher, System.IDisposable

Constructors

Initializes a new instance of the TagBites.IO.FileSystemLinkWatcher class for a specified link system and full name.

protected void FileSystemLinkWatcher(IFileSystemLink link, bool recursive)

Result Type: void

Parameters

TypeName
IFileSystemLinklinkThe link to a file/directory/file version.
boolrecursiveto watch the current directory, all its subdirectories; otherwise, .

Properties

FileSystem

Gets the file system to which the TagBites.IO.FileSystemLinkWatcher.Link belongs. <returns>A TagBites.IO.FileSystem> object representing file system to which the handle belongs.</returns>

protected FileSystem FileSystem { get; }

Result Type: FileSystem

Gets the link to a file/directory/file version. <return>A TagBites.IO.IFileSystemLink object representing the link to the file/directory/file version.</return>

public IFileSystemLink Link { get; }

Result Type: IFileSystemLink

Recursive

Gets a value indicating whether to watch the current directory, all its subdirectories. <returns><see langword="true" /> to watch the current directory, all its subdirectories; otherwise, <see langword="false" />.</returns>

protected bool Recursive { get; }

Result Type: bool

Methods

Dispose()

public void Dispose()

Result Type: void

Dispose(bool)

Releases all resources used by this.

protected void Dispose(bool disposing)

Result Type: void

Parameters

TypeName
booldisposingto release both managed and unmanaged resources; to release only unmanaged resources.

OnChanged(string)

Raises the TagBites.IO.FileSystemLinkWatcher.Changed event.

protected void OnChanged(string fullName)

Result Type: void

Parameters

TypeName
stringfullNameThe full path of the directory or file.

OnCreated(string)

Raises the TagBites.IO.FileSystemLinkWatcher.Created event.

protected void OnCreated(string fullName)

Result Type: void

Parameters

TypeName
stringfullNameThe full path of the directory or file.

OnDeleted(string)

Raises the TagBites.IO.FileSystemLinkWatcher.Deleted event.

protected void OnDeleted(string fullName)

Result Type: void

Parameters

TypeName
stringfullNameThe full path of the directory or file.

OnMoved(string, string)

Raises the TagBites.IO.FileSystemLinkWatcher.Moved event.

protected void OnMoved(string sourceFullName, string destinationFullName)

Result Type: void

Parameters

TypeName
stringsourceFullNameThe full path of the source directory or file.
stringdestinationFullNameThe full path of the destination directory or file.

Events

Changed

Occurs when the file system link is changed.

public EventHandler<FileSystemLinkChangeEventArgs> Changed

Result Type: EventHandler<FileSystemLinkChangeEventArgs>

Created

Occurs when the file system link is created.

public EventHandler<FileSystemLinkChangeEventArgs> Created

Result Type: EventHandler<FileSystemLinkChangeEventArgs>

Deleted

Occurs when the file system link is deleted.

public EventHandler<FileSystemLinkChangeEventArgs> Deleted

Result Type: EventHandler<FileSystemLinkChangeEventArgs>

Moved

Occurs when the file system link is moved.

public EventHandler<FileSystemLinkMoveEventArgs> Moved

Result Type: EventHandler<FileSystemLinkMoveEventArgs>