protected virtual void OnSynchronized(object sender, FileSystemSynchronizedEventArgs ev) { if (Synchronized != null) { Synchronized(sender, ev); } }
public void Synchronize(SyncDirectionOrder syncDirection, KnowledgeSyncProvider localProvider, KnowledgeSyncProvider remoteProvider, uint batchSize) { FileStoreSync fileStoreSync = localProvider as FileStoreSync; fileStoreSync.RequestedBatchSize = batchSize; ((FileStoreProxy)remoteProvider).RequestedBatchSize = batchSize; // Use sync-callbacks for conflicting items SyncCallbacks destCallbacks = localProvider.DestinationCallbacks; destCallbacks.ItemConflicting += new EventHandler <ItemConflictingEventArgs>(OnItemConflicting); destCallbacks.ItemConstraint += new EventHandler <ItemConstraintEventArgs>(OnItemConstraint); localProvider.Configuration.ConflictResolutionPolicy = ConflictResolutionPolicy.SourceWins; remoteProvider.Configuration.ConflictResolutionPolicy = ConflictResolutionPolicy.SourceWins; // Initiate orchestrator and sync SyncOrchestrator orchestrator = new SyncOrchestrator(); orchestrator.LocalProvider = localProvider; orchestrator.RemoteProvider = remoteProvider; // Set sync direction orchestrator.Direction = syncDirection; // Execute the synchronize process SyncOperationStatistics syncStats = orchestrator.Synchronize(); // Notify a synchronization took place FileSystemSynchronizedEventArgs ev = new FileSystemSynchronizedEventArgs(syncStats); OnSynchronized(orchestrator, ev); }
private void OnFileSystemSynchronized(object sender, FileSystemSynchronizedEventArgs ev) { OnUploadSynchronized(sender, ev); }