Click to Rate and Give Feedback

  Switch on low bandwidth view
FileSyncProvider Class

Is a synchronous synchronization provider that can be used to synchronize files, folders, and subfolders in NTFS, FAT, or SMB file systems.

Namespace: Microsoft.Synchronization.Files
Assembly: Microsoft.Synchronization.Files (in microsoft.synchronization.files.dll)
Visual Basic (Declaration)
Public Class FileSyncProvider
    Inherits UnmanagedSyncProviderWrapper
    Implements IDisposable
Visual Basic (Usage)
Dim instance As FileSyncProvider
C#
public class FileSyncProvider : UnmanagedSyncProviderWrapper, IDisposable
C++
public ref class FileSyncProvider : public UnmanagedSyncProviderWrapper, IDisposable
J#
public class FileSyncProvider extends UnmanagedSyncProviderWrapper implements IDisposable
JScript
public class FileSyncProvider extends UnmanagedSyncProviderWrapper implements IDisposable

To synchronize all files and subfolders in a directory, pass the replica ID and root directory to FileSyncProvider(Guid,String), and pass the provider to a SyncAgent object to handle the synchronization session.

By default, synchronization metadata is stored in a Metadata Storage Service database file in the root directory of the replica. To customize the location and name of this file, specify these by using FileSyncProvider(Guid,String,FileSyncScopeFilter,FileSyncOptions,String,String,String,String).

Control over which files and folders are included in the synchronization scope can be accomplished by configuring a FileSyncScopeFilter and passing it to the provider's constructor. The filter contains properties that can be used to exclude a list of files, exclude a list of folders, exclude files and folders based on their attributes, and explicitly include a list of files.

A number of configuration options, FileSyncOptions, are available to control how the provider behaves during synchronization, for example, whether it moves deleted files to the recycle bin or deletes them permanently from the file system.

A variety of events are available to the application that wants to show progress or dynamically skip particular changes during the session.

The provider can be put into preview mode by setting PreviewMode to true before starting synchronization. While in preview mode, the provider will perform all actions as if a real synchronization session is occurring, including firing all events. However, the provider will not actually apply any changes to the destination replica.

NoteNote

Concurrent synchronization operations to the same file store are not supported. If another provider instance was previously initialized with the same replica (that is, the same values for directory path and metadata file path), but has not yet been released, the constructor will throw a ReplicaMetadataInUseException from the metadata store.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker