FileSyncScopeFilter Class

Defines filters that can be used to include or exclude files and folders from the static synchronization scope.

System.Object
  Microsoft.Synchronization.Files.FileSyncScopeFilter

Namespace:  Microsoft.Synchronization.Files
Assembly:  Microsoft.Synchronization.Files (in Microsoft.Synchronization.Files.dll)

'Declaration
Public Class FileSyncScopeFilter
'Usage
Dim instance As FileSyncScopeFilter

The FileSyncScopeFilter type exposes the following members.

  NameDescription
Public methodFileSyncScopeFilterInitializes a new instance of the FileSyncScopeFilter class that has empty values for all filters.
Public methodFileSyncScopeFilter(IEnumerable(Of String), IEnumerable(Of String), FileAttributes, IEnumerable(Of String))Initializes a new instance of the FileSyncScopeFilter class that is based on a list of files to exclude, a list of subdirectories to exclude, an attribute mask to use to exclude files and folders, and a list of file names to explicitly include.
Top

  NameDescription
Public propertyAttributeExcludeMaskGets or sets the attributes that are used to exclude files and folders from the scope.
Public propertyFileNameExcludesGets the collection of file names to exclude from the scope.
Public propertyFileNameIncludesGets the collection of file names to explicitly include in the scope.
Public propertySubdirectoryExcludesGets the collection of relative paths of directories to exclude from the scope.
Top

  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top

The static filters are evaluated on change detection and are applied equally to all items in the synchronization scope. For an item to be included in the synchronization, it must pass all static filters. For example, if a file is both explicitly excluded and explicitly included, the file will be excluded from the scope.

The same scope filter should be used on all providers in a synchronization community. If not, unwanted behavior might occur.

The filter that is passed to #ctor is used to initialize the provider object based on the scope filter when it is passed in. Subsequent changes to the filter will not affect the scope filter that is used by that instance of the provider. To change the scope filter that is used, you must create a new file synchronization provider object.

Changing the scope of a replica after the first synchronization can cause unintended side effects. For example, suppose sometime after the first synchronization you change the scope on replica A to start excluding *.txt. This will cause all files that have a .txt extension to be treated by replica A as deleted. No files will actually be deleted from replica A. However, metadata for A will contain tombstones for .txt files, and A will send delete changes to other replicas for the .txt files. If you also exclude *.txt on replica B, there is no effect, because B will filter changes from A that pertain to .txt files. However, if replica B does not change its filter, the deleted files will flow to it, be treated as real change requests, and be deleted from replica B.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: