public static void SyncLibraryLocalFiles(Library library, SyncLog syncLog, CancellationToken cancellationToken) { if (cancellationToken.IsCancellationRequested) return; syncLog.StartLogging(); syncLog.AddRecord(string.Format("Sync {0}", library.Name)); var result = SyncPrimaryRoot( library, false, syncLog, cancellationToken); if (result != SynchronizationResult.Completed || cancellationToken.IsCancellationRequested) return; result = SyncSpecialFolder( Path.Combine(library.Path, Constants.RegularPreviewContainersRootFolderName), Path.Combine(GetLibrarySyncDestinationPath(library, false), Constants.RegularPreviewContainersRootFolderName), syncLog, cancellationToken); if (result != SynchronizationResult.Completed || cancellationToken.IsCancellationRequested) return; if (library.Calendar.Enabled) { result = SyncSpecialFolder( library.Calendar.Path, Path.Combine(GetLibrarySyncDestinationPath(library, false), Constants.OvernightsCalendarRootFolderName), syncLog, cancellationToken); if (result != SynchronizationResult.Completed || cancellationToken.IsCancellationRequested) return; } if (library.ProgramData.Enable) { result = SyncSpecialFolder( library.ProgramData.Path, Path.Combine(GetLibrarySyncDestinationPath(library, false), Constants.ProgramManagerRootFolderName), syncLog, cancellationToken); if (result != SynchronizationResult.Completed || cancellationToken.IsCancellationRequested) return; } syncLog.FinishLoging(); }
public static void SyncLibraryWebFiles(Library library, SyncLog syncLog, CancellationToken cancellationToken) { if (cancellationToken.IsCancellationRequested) return; syncLog.StartLogging(); syncLog.AddRecord(string.Format("Sync {0}", library.Name)); var result = SyncPrimaryRoot( library, true, syncLog, cancellationToken); if (result != SynchronizationResult.Completed || cancellationToken.IsCancellationRequested) return; result = SyncSpecialFolder( Path.Combine(library.Path, Constants.WebPreviewContainersRootFolderName), Path.Combine(GetLibrarySyncDestinationPath(library, true), Constants.WebPreviewContainersRootFolderName), syncLog, cancellationToken); if (result != SynchronizationResult.Completed || cancellationToken.IsCancellationRequested) return; syncLog.FinishLoging(); }