Share via


FileSyncProvider.ApplyingChange Event

Occurs when a file change is about to be tried.

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

Syntax

'Declaration
Public Event ApplyingChange As EventHandler(Of ApplyingChangeEventArgs)
'Usage
Dim instance As FileSyncProvider
Dim handler As EventHandler(Of ApplyingChangeEventArgs)

AddHandler instance.ApplyingChange, handler
public event EventHandler<ApplyingChangeEventArgs> ApplyingChange
public:
 event EventHandler<ApplyingChangeEventArgs^>^ ApplyingChange {
    void add (EventHandler<ApplyingChangeEventArgs^>^ value);
    void remove (EventHandler<ApplyingChangeEventArgs^>^ value);
}
member ApplyingChange : IEvent<EventHandler<ApplyingChangeEventArgs>,
    ApplyingChangeEventArgs>
JScript supports the use of events, but not the declaration of new ones.

Remarks

This event provides a mechanism for the application to dynamically skip changes during a synchronization session. To skip a change, set the SkipChange property to true. A change that is skipped will not be applied to the destination replica. A SkippedChange event will be fired with SkippedChangeEventArgs.SkipReason set to ApplicationRequest for each change that is skipped.

Some changes are tried more than one time during the course of a session. On each attempt, this event is fired. For example, an attempt is made to delete a folder. Because there is an existing file in the folder, the attempt fails. This folder delete operation will continue to be tried throughout the session until either the delete operation is successful or it is determined that the delete operation cannot occur during this session and is skipped.

This event will be raised only when a change affects file data on the destination replica and not when a change affects only the metadata for a file. For example, if an update-update conflict is detected and the file on the destination system is picked as the winner, no change is applied to the destination and this event will not be fired. Similarly, propagating a tombstone from the source to the destination causes only a metadata update and no change to the destination file system. In this case, this event will not be fired.

The ApplyingChangeEventArgs class provides the type of the change, the current file data, the file data as it will be if the change is applied, and the SkipChange property. This property can be used to dynamically skip this change.

See Also

Reference

FileSyncProvider Class

Microsoft.Synchronization.Files Namespace