Share via


FileSyncScopeFilter Class

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

Inheritance Hierarchy

System.Object
  Microsoft.Synchronization.Files.FileSyncScopeFilter

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

Syntax

'Declaration
Public Class FileSyncScopeFilter
'Usage
Dim instance As FileSyncScopeFilter
public class FileSyncScopeFilter
public ref class FileSyncScopeFilter
type FileSyncScopeFilter =  class end
public class FileSyncScopeFilter

The FileSyncScopeFilter type exposes the following members.

Constructors

  Name Description
Public method FileSyncScopeFilter() Initializes a new instance of the FileSyncScopeFilter class that has empty values for all filters.
Public method FileSyncScopeFilter(IEnumerable<String>, IEnumerable<String>, FileAttributes, IEnumerable<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

Properties

  Name Description
Public property AttributeExcludeMask Gets or sets the attributes that are used to exclude files and folders from the scope.
Public property FileNameExcludes Gets the collection of file names to exclude from the scope.
Public property FileNameIncludes Gets the collection of file names to explicitly include in the scope.
Public property SubdirectoryExcludes Gets the collection of relative paths of directories to exclude from the scope.

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)

Top

Remarks

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.

Thread Safety

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

See Also

Reference

Microsoft.Synchronization.Files Namespace