public override async Task DeleteSelectedFile(Thumbnail item) { var cds = UpnpDevice.Services[URN.ContentDirectory]; await DeleteDlnaContentAsync(cds, (item.Source as DlnaContentInfo)?.Id); ContentsCollection.Remove(item); }
public override Task DeleteSelectedFiles(IEnumerable <Thumbnail> items) { foreach (var item in items) { ContentsCollection.Remove(item); } return(Task.Delay(1000)); }
public override async Task DeleteSelectedFile(Thumbnail item) { var data = item.Source as RemoteApiContentInfo; var contents = new TargetContents(); contents.ContentUris = new List <string>(); contents.ContentUris.Add(data.Uri); await DeleteRemoteApiContents(contents); ContentsCollection.Remove(item); }
public override async Task DeleteSelectedFiles(IEnumerable <Thumbnail> items) { var uris = items .Select(item => item.Source as RemoteApiContentInfo) .Where(info => info != null) .Select(info => info.Uri).ToList(); await DeleteRemoteApiContents(new TargetContents { ContentUris = uris }); foreach (var item in items) { ContentsCollection.Remove(item); } }
private async Task TryDeleteLocalFile(Thumbnail data) { try { DebugUtil.Log(() => "Delete " + data.CacheFile?.DisplayName); await data.CacheFile?.DeleteAsync(); ContentsCollection.Remove(data); } catch (Exception ex) { DebugUtil.Log(() => "Failed to delete file: " + ex.StackTrace); } }
public override async Task DeleteSelectedFiles(IEnumerable <Thumbnail> items) { DebugUtil.Log("DeleteSelectedImages"); var dlna = items .Select(item => item.Source as DlnaContentInfo) .Where(info => info != null) .Select(info => info.Id).ToList(); await DeleteDlnaContentsAsync(dlna); foreach (var item in items) { ContentsCollection.Remove(item); } }
public override Task DeleteSelectedFile(Thumbnail item) { ContentsCollection.Remove(item); return(Task.Delay(100)); }