SyncAgent.Synchronize Method

Synchronizes data between the local and remote data stores.

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


Public Function Synchronize As SyncStatistics
Dim instance As SyncAgent
Dim returnValue As SyncStatistics

returnValue = instance.Synchronize()
public SyncStatistics Synchronize()
SyncStatistics^ Synchronize()
member Synchronize : unit -> SyncStatistics 
public function Synchronize() : SyncStatistics

Return Value

Type: Microsoft.Synchronization.Data.SyncStatistics
A SyncStatistics object that contains statistics for a synchronization session.


The following code examples call the Synchronize method of a class that derives from SyncAgent, and then write information to the console. To view this code in the context of a complete example, see Getting Started: Client and Server Synchronization.

SampleSyncAgent sampleSyncAgent = new SampleSyncAgent();
SyncStatistics syncStatistics = sampleSyncAgent.Synchronize();
Console.WriteLine("Start Time: " + syncStatistics.SyncStartTime);
Console.WriteLine("Total Changes Downloaded: " + syncStatistics.TotalChangesDownloaded);
Console.WriteLine("Complete Time: " + syncStatistics.SyncCompleteTime);
Dim sampleSyncAgent As New SampleSyncAgent()
Dim syncStatistics As SyncStatistics = sampleSyncAgent.Synchronize()
Console.WriteLine("Start Time: " & syncStatistics.SyncStartTime)
Console.WriteLine("Total Changes Downloaded: " & syncStatistics.TotalChangesDownloaded)
Console.WriteLine("Complete Time: " & syncStatistics.SyncCompleteTime)

See Also


SyncAgent Class

Microsoft.Synchronization Namespace