private void Loadthumbnails(VideoFolder item) { Dispatcher.Invoke(new Action(delegate { if (item.FileType == FileType.Folder) { Task.Factory.StartNew(() => GetItems(item)) .ContinueWith(t => item = t.Result, TaskScheduler.FromCurrentSynchronizationContext()); return; } else { var itemchild = (VideoFolderChild)item; using (ShellObject shell = ShellObject.FromParsingName(itemchild.FilePath)) { if (CollectionVM.ViewType == ViewType.Large) { itemchild.Thumbnail = shell.Thumbnail.LargeBitmapSource; } IShellProperty prop = shell.Properties.System.Media.Duration; itemchild.Duration = prop.FormatForDisplay(PropertyDescriptionFormat.ShortTime); var duration = shell.Properties.System.Media.Duration; if (duration.Value != null) { itemchild.MaxiProgress = double.Parse(duration.Value.ToString()); } if (files == null) { files = FileExplorerCommonHelper.GetSubtitleFiles(CollectionVM.VideoDataAccess.Directory); } } itemchild.SubPath = GetSubtitlePath(item); } })); }
private List <SubtitleFilesModel> GetSubtitlePath(VideoFolder item) { return(FileExplorerCommonHelper.MatchSubToMedia(item.Name, files)); }