FileSystemLinkSynchronizer

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

Provides synchronization mechanism for file systems.

public class FileSystemLinkSynchronizer : System.IDisposable

Constructors

FileSystemLinkSynchronizer()

public void FileSystemLinkSynchronizer()

Result Type: void

Properties

Enabled

Gets or sets a value indicating whether the synchronizer is enabled. <returns><see langword="true" /> if the synchronizer is enabled; otherwise, <see langword="false" />.</returns>

public bool Enabled { get; set; }

Result Type: bool

Synchronized

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

public bool? Synchronized { get; }

Result Type: bool?<bool>

Methods

Adds pair file/directory and directory to synchronization list with specified synchronization mode.

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

Result Type: void

Parameters

TypeName
FileSystemStructureLinksourceThe link to source the file/directory.
DirectoryLinkdestinationThe link to the destination directory.
FileSystemSynchronizeModemodeThe file system synchronization mode.

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.

ForceSyncAsync()

Asynchronously forces synchronization.

public Task ForceSyncAsync()

Result Type: Task

Removes pair file/directory and directory from synchronization list.

public bool Remove(FileSystemStructureLink source, DirectoryLink destination)

Result Type: bool

Parameters

TypeName
FileSystemStructureLinksourceThe link to source the file/directory.
DirectoryLinkdestinationThe link to the destination directory

WaitForSync()

Waits for synchronization.

public void WaitForSync()

Result Type: void

WaitForSync(TimeSpan)

Waits for synchronization for specified timeout.

public void WaitForSync(TimeSpan timeout)

Result Type: void

Parameters

TypeName
TimeSpantimeoutThe synchronization timeout.

WaitForSync(int)

Waits for synchronization for specified timeout in milliseconds.

public void WaitForSync(int timeoutInMilliseconds)

Result Type: void

Parameters

TypeName
inttimeoutInMillisecondsThe synchronization timeout in milliseconds.