public async void RequestAnnotationSync(IAnnotationSyncTask task) { if (GlobalAccess.Instance.CurrentUserInfo == null) { return; } if (GlobalAccess.Instance.CurrentUserInfo.SyncAnnotations) { annotationSyncQueue.Enqueue(task); try { await syncLock.Enter(); if (!isSyncRunning && annotationSyncQueue.Count > 0) { //Start Queue Processor.... isSyncRunning = true; PerformSync().WithNoWarning(); } } finally { syncLock.Release(); } } }
public AnnotationTaskContext(IAnnotationSyncTask annotationSyncTask, ISyncService syncService, IAnnotationAccess annotationAccess) { this.AnnotationSyncTask = annotationSyncTask; this.SyncService = syncService; this.AnnotationAccess = annotationAccess; var uerFolder = GlobalAccess.Instance.CurrentUserInfo.UserFolder; this.AnnotationDownloadFile = Path.Combine(uerFolder, Constants.AnnotationDownZip); this.AnnotationDownloadTempFolder = Path.Combine(uerFolder, Constants.AnnotationDown); }