Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Represents statistics about a bidirectional synchronization session.
System.Object
Microsoft.Synchronization.SyncOperationStatistics
Namespace: Microsoft.Synchronization
Assembly: Microsoft.Synchronization (in Microsoft.Synchronization.dll)
'Declaration
<SerializableAttribute> _
Public Class SyncOperationStatistics
'Usage
Dim instance As SyncOperationStatistics
[SerializableAttribute]
public class SyncOperationStatistics
[SerializableAttribute]
public ref class SyncOperationStatistics
[<SerializableAttribute>]
type SyncOperationStatistics = class end
public class SyncOperationStatistics
The SyncOperationStatistics type exposes the following members.
Name | Description | |
---|---|---|
![]() |
DownloadChangesApplied | Gets the total number of changes that were successfully applied during the download session. |
![]() |
DownloadChangesFailed | Gets the total number of changes that were not applied during the download session. |
![]() |
DownloadChangesTotal | Gets the total number of changes that were tried during the download session. |
![]() |
SyncEndTime | Gets or sets the date and time when the synchronization session ended. |
![]() |
SyncStartTime | Gets or sets the date and time when the synchronization session started. |
![]() |
UploadChangesApplied | Gets the total number of changes that were successfully applied during the upload session. |
![]() |
UploadChangesFailed | Gets the total number of changes that failed to apply during the upload session. |
![]() |
UploadChangesTotal | Gets the total number of changes that were tried during the upload session. |
Top
Name | Description | |
---|---|---|
![]() |
Equals | (Inherited from Object.) |
![]() |
Finalize | (Inherited from Object.) |
![]() |
GetHashCode | (Inherited from Object.) |
![]() |
GetType | (Inherited from Object.) |
![]() |
MemberwiseClone | (Inherited from Object.) |
![]() |
ToString | (Inherited from Object.) |
Top
The following example synchronizes data between two providers and displays the synchronization statistics to the user.
' Create the synchronization orchestrator and set the providers and synchronization direction.
Dim orchestrator As New SyncOrchestrator()
orchestrator.LocalProvider = localProvider
orchestrator.RemoteProvider = remoteProvider
orchestrator.Direction = syncDir
Dim msg As String
Try
' Synchronize data between the two providers.
Dim stats As SyncOperationStatistics = orchestrator.Synchronize()
' Display statistics for the synchronization operation.
msg = ((("Synchronization succeeded!" & vbLf & vbLf & stats.DownloadChangesApplied & " download changes applied" & vbLf) & stats.DownloadChangesFailed & " download changes failed" & vbLf) & stats.UploadChangesApplied & " upload changes applied" & vbLf) & stats.UploadChangesFailed & " upload changes failed"
Catch ex As Exception
msg = "Synchronization failed! Here's why: " & vbLf & vbLf & ex.Message
End Try
MessageBox.Show(msg, "Synchronization Results")
End Sub
// Create the synchronization orchestrator and set the providers and synchronization direction.
SyncOrchestrator orchestrator = new SyncOrchestrator();
orchestrator.LocalProvider = localProvider;
orchestrator.RemoteProvider = remoteProvider;
orchestrator.Direction = syncDir;
string msg;
try
{
// Synchronize data between the two providers.
SyncOperationStatistics stats = orchestrator.Synchronize();
// Display statistics for the synchronization operation.
msg = "Synchronization succeeded!\n\n" +
stats.DownloadChangesApplied + " download changes applied\n" +
stats.DownloadChangesFailed + " download changes failed\n" +
stats.UploadChangesApplied + " upload changes applied\n" +
stats.UploadChangesFailed + " upload changes failed";
}
catch (Exception ex)
{
msg = "Synchronization failed! Here's why: \n\n" + ex.Message;
}
MessageBox.Show(msg, "Synchronization Results");
}
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.