Skip to content
Auto
Products

FileSystemLinkSynchronizer

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

Provides a synchronization mechanism for file systems.

public class FileSystemLinkSynchronizer : System.IDisposable

Inheritance: object → FileSystemLinkSynchronizer

public FileSystemLinkSynchronizer()

Gets or sets a value indicating whether the synchronizer is enabled.

public bool Enabled { get; set; }

bool

true if the synchronizer is enabled; otherwise, false.

Gets a value indicating whether the files and directories are synchronized.

public bool? Synchronized { get; }

bool?

true if the files and directories are synchronized; otherwise, false. If no value is set, returns a null reference.

Section titled “Add(FileSystemStructureLink, DirectoryLink, FileSystemSynchronizeMode)”

Adds a pair of links to the synchronization list with the specified mode.

public void Add(FileSystemStructureLink source, DirectoryLink destination, FileSystemSynchronizeMode mode)
public virtual void Dispose()

Releases all resources used by this.

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

Asynchronously forces synchronization.

public Task ForceSyncAsync()

Task

The task object representing the asynchronous operation.

Section titled “Remove(FileSystemStructureLink, DirectoryLink)”

Removes a pair of links from the synchronization list.

public bool Remove(FileSystemStructureLink source, DirectoryLink destination)

bool

true if the pair was removed; otherwise, false.

Waits for synchronization.

public void WaitForSync()

Waits for the synchronization to finish, up to the specified timeout.

public void WaitForSync(TimeSpan timeout)
  • timeout TimeSpan
    The synchronization timeout.

Waits for the synchronization to finish, up to the specified timeout in milliseconds.

public void WaitForSync(int timeoutInMilliseconds)
  • timeoutInMilliseconds int
    The synchronization timeout in milliseconds.

Occurs when a synchronization attempt fails.

public EventHandler<FileSystemLinkSyncFailedEventArgs> SyncFailed

EventHandler<FileSystemLinkSyncFailedEventArgs>

A failed pair is retried up to ten times before it is abandoned, and the event is raised for every attempt. Handlers run on the background synchronization thread, and an exception thrown by a handler is ignored so that it cannot stop the synchronizer.