protected virtual Task OnDrop(DragEventArgs e) { try { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { var paths = e.Data.GetData(DataFormats.FileDrop) as IEnumerable <string>; return(this.AddToPlaylist(paths)); } #if VISTA if (ShellIDListHelper.GetDataPresent(e.Data)) { var paths = ShellIDListHelper.GetData(e.Data); return(this.AddToPlaylist(paths)); } #endif } catch (Exception exception) { Logger.Write(this, LogLevel.Warn, "Failed to process clipboard contents: {0}", exception.Message); } #if NET40 return(TaskEx.FromResult(false)); #else return(Task.CompletedTask); #endif }
protected virtual Task OnDrop(DragEventArgs e) { try { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { var paths = e.Data.GetData(DataFormats.FileDrop) as IEnumerable<string>; return this.FileActionHandlerManager.RunPaths(paths, FileActionType.Library); } if (ShellIDListHelper.GetDataPresent(e.Data)) { var paths = ShellIDListHelper.GetData(e.Data); return this.LibraryManager.Add(paths); } } catch (Exception exception) { Logger.Write(this, LogLevel.Warn, "Failed to process clipboard contents: {0}", exception.Message); } #if NET40 return TaskEx.FromResult(false); #else return Task.CompletedTask; #endif }
protected virtual Task OnDrop(DragEventArgs e) { try { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { var paths = e.Data.GetData(DataFormats.FileDrop) as IEnumerable <string>; return(this.AddToPlaylist(paths)); } if (e.Data.GetDataPresent(typeof(LibraryHierarchyNode))) { var libraryHierarchyNode = e.Data.GetData(typeof(LibraryHierarchyNode)) as LibraryHierarchyNode; return(this.AddToPlaylist(libraryHierarchyNode)); } if (e.Data.GetDataPresent <IEnumerable <PlaylistItem> >(true)) { var playlistItems = e.Data .GetData <IEnumerable <PlaylistItem> >(true) .OrderBy(playlistItem => playlistItem.Sequence); return(this.AddToPlaylist(playlistItems)); } #if VISTA if (ShellIDListHelper.GetDataPresent(e.Data)) { var paths = ShellIDListHelper.GetData(e.Data); return(this.AddToPlaylist(paths)); } #endif } catch (Exception exception) { Logger.Write(this, LogLevel.Warn, "Failed to process clipboard contents: {0}", exception.Message); } #if NET40 return(TaskEx.FromResult(false)); #else return(Task.CompletedTask); #endif }