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; }
Methods
Add(FileSystemStructureLink, DirectoryLink, FileSystemSynchronizeMode)
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
Type | Name | |
---|---|---|
FileSystemStructureLink | source | The link to source the file/directory. |
DirectoryLink | destination | The link to the destination directory. |
FileSystemSynchronizeMode | mode | The 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
Type | Name | |
---|---|---|
bool | disposing | to release both managed and unmanaged resources; to release only unmanaged resources. |
ForceSyncAsync()
Asynchronously forces synchronization.
public Task ForceSyncAsync()
Result Type: Task
Remove(FileSystemStructureLink, DirectoryLink)
Removes pair file/directory and directory from synchronization list.
public bool Remove(FileSystemStructureLink source, DirectoryLink destination)
Result Type: bool
Parameters
Type | Name | |
---|---|---|
FileSystemStructureLink | source | The link to source the file/directory. |
DirectoryLink | destination | The 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
Type | Name | |
---|---|---|
TimeSpan | timeout | The synchronization timeout. |
WaitForSync(int)
Waits for synchronization for specified timeout in milliseconds.
public void WaitForSync(int timeoutInMilliseconds)
Result Type: void
Parameters
Type | Name | |
---|---|---|
int | timeoutInMilliseconds | The synchronization timeout in milliseconds. |