Microsoft.Synchronization.Files Namespace

The file synchronization provider is a component of Sync Framework that helps an application synchronize files, folders, and subfolders in NTFS, FAT, or SMB file systems. The directories to synchronize can be local or remote and do not have to be of the same file system. Static filters can be used to exclude or include files either by listing them explicitly or by using wildcard characters, such as *.txt; or filters can be set that exclude individual subfolders. Progress reports can be obtained by registering to receive notifications during synchronization.

The centerpiece of the service is FileSyncProvider. Because it implements KnowledgeSyncProvider, the file synchronization provider only has to be created, initialized, and passed to a SyncAgent to perform synchronization.

A static filter is represented by FileSyncScopeFilter and can be used for finer control over which files or folders participate in synchronization.

Several events are available from the file synchronization provider, such as AppliedChange and CopyingFile. An application can register to receive notifications from any of these events. This enables the application to show synchronization progress to the user or take some other action.

The file synchronization provider uses the metadata storage service to store all synchronization metadata in a lightweight database. The metadata database is a single file. This file can be stored with the files and folders to be synchronized or in another location that is specified when the provider is initialized. For more information, see Sync Framework Metadata Storage Service.

For more information about how to use the file synchronization provider, see Synchronizing Files.

Classes

  Class Description
Public class AppliedChangeEventArgs Provides data for the AppliedChange event.
Public class ApplyingChangeEventArgs Provides data for the ApplyingChange event.
Public class CopyingFileEventArgs Provides data for the CopyingFile event.
Public class DetectedChangesEventArgs Provides data for the DetectedChanges event.
Public class DetectingChangesEventArgs Provides data for the DetectingChanges event.
Public class FileData Represents information about a file or directory. This is a loose wrapper of the WIN32_FIND_DATA structure that contains additional path information.
Public class FileSyncInvalidOperationException The exception that is thrown when a method call is invalid for the current state of the object.
Public class FileSyncProvider Is a synchronous synchronization provider that can be used to synchronize files, folders, and subfolders in NTFS, FAT, or SMB file systems.
Public class FileSyncScopeFilter Defines filters that can be used to include or exclude files and folders from the static synchronization scope.
Public class SkippedChangeEventArgs Provides data for the SkippedChange event.
Public class SkippedFileDetectEventArgs Provides data for the SkippedFileDetect event.

Interfaces

  Interface Description
Public interface IFileDataRetriever Represents the mechanism by which a file synchronization provider and a custom provider transfer data between each other.

Enumerations

  Enumeration Description
Public enumeration ChangeType Represents the different types of changes that can be applied to a destination replica.
Public enumeration FileSyncOptions Provides options to configure the behavior of the file synchronization provider.
Public enumeration SkipReason Represents the reason why a file was skipped during change detection or change application.