public void RequestFileUpdate(WatchedFolder folder)
 {
     lock (_wantUpdateFolders)
     {
         _wantUpdateFolders.Add(folder);
         Execute.BeginOnUIThread(() => IsRefreshing = true);
     }
     if (!_refreshSuspended)
         RestartCountdown();
 }
 private async Task<WatchedFolder> TryAddKnownFolder(string name, ICollection<WatchedFolder> folders)
 {
     try
     {
         var folder = new WatchedFolder((StorageFolder)typeof(KnownFolders).GetRuntimeProperty(name).GetValue(null));
         folders.Add(folder);
         var cache = new FolderCacheProvider(_playlist.Key, name);
         _knownFolderCaches.Add(folder, cache);
         await cache.LoadCache();
         folder.FileUpdateRequested += Folder_FileUpdateRequested;
         return folder;
     }
     catch (Exception)
     {
         Debug.WriteLine($"Error in adding knwon folder: {name}.");
         return null;
     }
 }
 private async Task<WatchedFolder> TryAddFolder(string path, ICollection<WatchedFolder> folders)
 {
     try
     {
         var folder = new WatchedFolder(await StorageFolder.GetFolderFromPathAsync(path));
         folders.Add(folder);
         var cache = new FolderCacheProvider(_playlist.Key, path);
         _folderCaches.Add(folder, cache);
         await cache.LoadCache();
         folder.FileUpdateRequested += Folder_FileUpdateRequested;
         return folder;
     }
     catch (Exception)
     {
         Debug.WriteLine($"Error in adding folder: {path}.");
         return null;
     }
 }
 private void Folder_FileUpdateRequested(WatchedFolder folder)
 {
     _folderDispatcher.RequestFileUpdate(folder);
 }
 public void CancelFileUpdate(WatchedFolder folder)
 {
     lock (_wantUpdateFolders)
     {
         _wantUpdateFolders.Remove(folder);
         if (_wantUpdateFolders.Any())
             Execute.BeginOnUIThread(() => IsRefreshing = true);
     }
     if (!_refreshSuspended)
         RestartCountdown();
 }