Skip to content
Auto
Products

FileSystemLinkWatcher

Namespace: TagBites.IO
Assembly: TagBites.IO.dll
Product: TagBites.IO v. 2.0.0

Provides the base class for watchers that listen to file system notifications and raise events when a file or directory changes.

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

Inheritance: object → FileSystemLinkWatcher

Section titled “FileSystemLinkWatcher(IFileSystemLink, bool)”

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

protected FileSystemLinkWatcher(IFileSystemLink link, bool recursive)
  • link IFileSystemLink
    The link to a file/directory/file version.
  • recursive bool
    true to watch the current directory, all its subdirectories; otherwise, false.

Gets the file system to which the Link belongs.

protected FileSystem FileSystem { get; }

FileSystem

A FileSystem object representing file system to which the handle belongs.

Gets a value indicating whether this instance has been disposed.

public bool IsDisposed { get; }

bool

No event is raised once the watcher is disposed, including one already scheduled by a derived class.

Gets the link to a file/directory/file version.

public virtual IFileSystemLink Link { get; }

IFileSystemLink

A IFileSystemLink object representing the link to the file/directory/file version.

Gets a value indicating whether to watch the current directory, all its subdirectories.

protected bool Recursive { get; }

bool

true to watch the current directory, all its subdirectories; otherwise, false.

public virtual void Dispose()

Releases all resources used by this.

protected virtual void Dispose(bool disposing)
  • disposing bool
    true to release both managed and unmanaged resources; false to release only unmanaged resources.

Raises the Changed event.

protected void OnChanged(string fullName)
  • fullName string
    The full path of the directory or file.

Raises the Changed event.

protected void OnChanged(IFileSystemLink link)

Raises the Created event.

protected void OnCreated(string fullName)
  • fullName string
    The full path of the directory or file.

Raises the Created event.

protected void OnCreated(IFileSystemLink link)

Raises the Deleted event.

protected void OnDeleted(string fullName)
  • fullName string
    The full path of the directory or file.

Raises the Deleted event.

protected void OnDeleted(IFileSystemLink link)

Raises the Moved event.

protected void OnMoved(string sourceFullName, string destinationFullName)
  • sourceFullName string
    The full path of the source directory or file.
  • destinationFullName string
    The full path of the destination directory or file.

Raises the Moved event.

protected void OnMoved(IFileSystemLink source, IFileSystemLink destination)

Occurs when the file system link is changed.

public virtual EventHandler<FileSystemLinkChangeEventArgs> Changed

EventHandler<FileSystemLinkChangeEventArgs>

Occurs when the file system link is created.

public virtual EventHandler<FileSystemLinkChangeEventArgs> Created

EventHandler<FileSystemLinkChangeEventArgs>

Occurs when the file system link is deleted.

public virtual EventHandler<FileSystemLinkChangeEventArgs> Deleted

EventHandler<FileSystemLinkChangeEventArgs>

Occurs when the file system link is moved.

public virtual EventHandler<FileSystemLinkMoveEventArgs> Moved

EventHandler<FileSystemLinkMoveEventArgs>