示例#1
0
        public void Synchronization(int localPeerID, int remotePeerID)
        {
            try
            {
                localSyncProvider = SyncProviderHelper.CreateSyncProvider(localPeerID);
                localSyncProvider.SyncProviderPosition = SyncProviderPosition.Local;

                remoteSyncProvider = SyncProviderHelper.CreateSyncProvider(remotePeerID);
                remoteSyncProvider.SyncProviderPosition = SyncProviderPosition.Remote;
                collaborationSyncAgent = new SyncOrchestrator();
                collaborationSyncAgent.LocalProvider  = localSyncProvider;
                collaborationSyncAgent.RemoteProvider = remoteSyncProvider;
                collaborationSyncAgent.Direction      = SyncDirectionOrder.UploadAndDownload;
                syncStatistics = collaborationSyncAgent.Synchronize();
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.ToString());
            }
        }
示例#2
0
 private DbSyncProvider remoteSyncProvider = null; public void BeginSession()
 {
     remoteSyncProvider = SyncProviderHelper.CreateSyncProvider(2);
 }