SyncSessionContext.OnProgressChanged Method
Reports synchronization progress to the application.
Namespace: Microsoft.Synchronization
Assembly: Microsoft.Synchronization (in microsoft.synchronization.dll)
Syntax
'Declaration
Public Sub OnProgressChanged ( _
e As SyncStagedProgressEventArgs _
)
'Usage
Dim instance As SyncSessionContext
Dim e As SyncStagedProgressEventArgs
instance.OnProgressChanged(e)
public void OnProgressChanged (
SyncStagedProgressEventArgs e
)
public:
void OnProgressChanged (
SyncStagedProgressEventArgs^ e
)
public void OnProgressChanged (
SyncStagedProgressEventArgs e
)
public function OnProgressChanged (
e : SyncStagedProgressEventArgs
)
Parameters
- e
A SyncStagedProgressEventArgs object that contains the event data.
Remarks
This method can be used to report custom progress to the application. When a provider calls this method, the SyncOrchestrator.SessionProgress event is raised.
When ChangeApplication is specified for the Stage property of e, Sync Framework accumulates the total completed work that is specified by the CompletedWork property of e each time OnProgressChanged is called. Sync Framework also interprets the TotalWork property of e as the remaining work for the session and calculates the total work for the session by adding TotalWork to the accumulated value for completed work. Sync Framework then passes these calculated values to SyncOrchestrator.SessionProgress. When the Stage property of e is any other valid value, CompletedWork and TotalWork are passed directly to SyncOrchestrator.SessionProgress.
When the source provider specifies work estimates, unexpected results can occur if a provider calls OnProgressChanged and specifies ChangeApplication for the Stage property of e. This is because Sync Framework totals the completed work value each time progress notifications are sent during change application. If a provider sends its own progress notification and specifies ChangeApplication for Stage, Sync Framework adds the estimated work values that are specified by the provider to the total completed work for the session. This can cause the same work to be counted twice: one time when it is reported by Sync Framework and one time when it is reported by the provider.
See Also
Reference
SyncSessionContext Class
SyncSessionContext Members
Microsoft.Synchronization Namespace