Example #1
0
 protected virtual void OnSynchronized(object sender, FileSystemSynchronizedEventArgs ev)
 {
     if (Synchronized != null)
     {
         Synchronized(sender, ev);
     }
 }
Example #2
0
        public void Synchronize(SyncDirectionOrder syncDirection, KnowledgeSyncProvider localProvider, KnowledgeSyncProvider remoteProvider)
        {
            // Register event handlers
            FileSyncProvider fileSyncProvider = localProvider as FileSyncProvider;

            fileSyncProvider.AppliedChange += new EventHandler <AppliedChangeEventArgs>(OnAppliedChange);
            fileSyncProvider.SkippedChange += new EventHandler <SkippedChangeEventArgs>(OnSkippedChange);

            // Use sync-callbacks for conflicting items
            SyncCallbacks destCallbacks = localProvider.DestinationCallbacks;

            destCallbacks.ItemConflicting += new EventHandler <ItemConflictingEventArgs>(OnItemConflicting);
            destCallbacks.ItemConstraint  += new EventHandler <ItemConstraintEventArgs>(OnItemConstraint);

            // 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);
        }
Example #3
0
 public abstract void RemoveFileSystemSynchronized(object sender, FileSystemSynchronizedEventArgs ev);