public string GenerateThumb(MediaFileItem mediaFile) { using (new Tracer(mediaFile)) { try { var doc = new Microsoft.Office.Interop.Word.Application().Documents.Open(FileName: mediaFile.MediaLocation, Visible: false, ReadOnly: true); doc.ShowGrammaticalErrors = false; doc.ShowRevisions = false; doc.ShowSpellingErrors = false; byte[] bytes = doc.Range().EnhMetaFileBits; Image page = Image.FromStream(new MemoryStream(bytes)); doc.Close(WdSaveOptions.wdDoNotSaveChanges); Helper.Helper.GetThumb(page, mediaFile.Width, mediaFile.Height); } catch (Exception ex) { } return(_wordThumbPath); } }
private void importItem(FileInfo info) { try { ItemProgress = 0; MediaFileItem mediaFile = MediaFileItem.Factory.create(info.FullName); ItemInfo = "Importing: " + mediaFile.Location; MediaFileState.import(mediaFile, CancellationToken); ItemProgress = 1; TotalProgress++; InfoMessages.Add("Imported: " + mediaFile.Location); } catch (Exception e) { ItemInfo = "Error importing file: " + info.FullName; InfoMessages.Add("Error importing file: " + info.FullName + " " + e.Message); Logger.Log.Error("Error importing file: " + info.FullName, e); MessageBox.Show("Error importing file: " + info.FullName + "\n\n" + e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } }
private void saveMetadata(string fullpath, YoutubeVideoItem item) { YoutubeItemMetadata metadata = item.Metadata as YoutubeItemMetadata; MediaFileItem fileItem = MediaFileItem.Factory.create(fullpath); fileItem.EnterWriteLock(); try { YoutubeItemMetadata saveMetadata = metadata.Clone() as YoutubeItemMetadata; saveMetadata.Location = fullpath; ItemProgress = 0; ItemInfo = "Saving metadata: " + item.Name; MetadataFactory.write(saveMetadata, MetadataFactory.WriteOptions.WRITE_TO_DISK, this); ItemProgress = 100; InfoMessages.Add("Finished saving metadata: " + fullpath); } finally { fileItem.ExitWriteLock(); } /*fileItem.EnterUpgradeableReadLock(); * fileItem.readMetadata_URLock(MetadataFactory.ReadOptions.READ_FROM_DISK, CancellationToken); * fileItem.ExitUpgradeableReadLock();*/ }
public void OnNavigatedTo(NavigationContext navigationContext) { ICollection <MediaItem> selectedItems = MediaStateCollectionView.getSelectedItems(); MediaStateCollectionView.SelectionChanged += mediaState_SelectionChanged; EventAggregator.GetEvent <MediaSelectionEvent>().Subscribe(selectItems, ThreadOption.UIThread, false, selection => selection.SenderId.Equals(MediaStateCollectionView.Guid)); String location = (String)navigationContext.Parameters["location"]; if (!String.IsNullOrEmpty(location)) { MediaFileItem item = MediaFileItem.Factory.create(location); if (selectedItems.Count > 0 && selectedItems.ElementAt(0).Equals(item)) { // Send a selection event in the case the media is already selected // to inform other views EventAggregator.GetEvent <MediaSelectionEvent>().Publish(new MediaSelectionPayload(MediaStateCollectionView.Guid, item)); } else { selectItems(new MediaSelectionPayload(MediaStateCollectionView.Guid, item)); } } else { //MediaStateCollectionView.refresh(); } }
protected override void addImageInfo(int imageNr, Grid cell, string fontFamily, int margin) { if (Vm.IsAddInfo == false) { return; } cell.Margin = new Thickness(margin); MediaFileItem item = Items[imageNr]; TextBlock name = new TextBlock(); name.TextTrimming = TextTrimming.CharacterEllipsis; name.HorizontalAlignment = HorizontalAlignment.Center; name.VerticalAlignment = VerticalAlignment.Bottom; name.Text = Path.GetFileName(item.Location); name.Foreground = new SolidColorBrush(FontColor); Grid.SetRow(name, 0); cell.Children.Add(name); if (item.Metadata == null) { return; } VideoMetadata videoInfo = item.Metadata as VideoMetadata; MediaViewer.MediaDatabase.ImageMetadata imageInfo = item.Metadata as MediaViewer.MediaDatabase.ImageMetadata; TextBlock info = new TextBlock(); info.TextTrimming = TextTrimming.CharacterEllipsis; info.HorizontalAlignment = HorizontalAlignment.Center; info.VerticalAlignment = VerticalAlignment.Top; info.Foreground = new SolidColorBrush(FontColor); String infoText = ""; if (videoInfo != null) { infoText += videoInfo.Width + "x" + videoInfo.Height; } else { infoText += imageInfo.Width + "x" + imageInfo.Height; } infoText += ", " + MiscUtils.formatSizeBytes(item.Metadata.SizeBytes); info.Text = infoText; Grid.SetRow(info, 2); cell.Children.Add(info); }
public string GetThumb(MediaFileItem mediaFile) { if (mediaFile != null) { return(this.GenerateThumb(mediaFile)); } return(""); }
private void row_DoubleClick(Object sender, MouseButtonEventArgs e) { DataGridRow row = sender as DataGridRow; MediaFileItem item = row.DataContext as MediaFileItem; if (RowDoubleClick != null) { RowDoubleClick(this, item); } }
void export(ObservableCollection <ScanLocation> includeLocations, ObservableCollection <ScanLocation> excludeLocations) { List <String> items = new List <String>(); foreach (ScanLocation location in includeLocations) { if (CancellationToken.IsCancellationRequested) { return; } ItemInfo = "Searching files in: " + location.Location; Tuple <ScanLocation, ObservableCollection <ScanLocation>, List <String> > state = new Tuple <ScanLocation, ObservableCollection <ScanLocation>, List <String> >(location, excludeLocations, items); FileUtils.iterateFilesInDirectory(new DirectoryInfo(location.Location), getMediaFiles, state, location.IsRecursive); InfoMessages.Add("Completed searching files in: " + location.Location); } TotalProgressMax = items.Count; ItemProgressMax = 100; foreach (String item in items) { try { if (CancellationToken.IsCancellationRequested) { return; } ItemProgress = 0; MediaFileItem mediaFile = MediaFileItem.Factory.create(item); ItemInfo = "Exporting: " + mediaFile.Location; MediaFileState.export(mediaFile, CancellationToken); ItemProgress = 100; TotalProgress++; InfoMessages.Add("Exported: " + mediaFile.Location); } catch (Exception e) { ItemInfo = "Error exporting file: " + item; InfoMessages.Add("Error exporting file: " + item + " " + e.Message); Logger.Log.Error("Error exporting file: " + item, e); MessageBox.Show("Error exporting file: " + item + "\n\n" + e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } } }
public async Task generatePreviews() { await Task.Factory.StartNew(() => { try { TotalProgressMax = asyncState.Media.Count; for (TotalProgress = 0; TotalProgress < TotalProgressMax; TotalProgress++) { MediaFileItem item = asyncState.Media.ElementAt(TotalProgress); if (CancellationToken.IsCancellationRequested) { return; } if (!MediaFormatConvert.isVideoFile(item.Location)) { InfoMessages.Add("Skipping: " + item.Location + " is not a video file."); continue; } if (item.Metadata == null) { item.EnterUpgradeableReadLock(); try { item.readMetadata_URLock(MetadataFactory.ReadOptions.AUTO, CancellationToken); if (item.ItemState != MediaItemState.LOADED) { InfoMessages.Add("Skipping: " + item.Location + " could not read metadata."); continue; } } finally { item.ExitUpgradeableReadLock(); } } generatePreview(item); } } finally { App.Current.Dispatcher.Invoke(() => { OkCommand.IsExecutable = true; CancelCommand.IsExecutable = false; }); } }); }
public void GenerateThumb(MediaFileItem mediaFile) { string inputPath = GetFilePathFromUrl(mediaFile.Url, WebRequestContext.Localization); if (inputPath.Contains("\\" + _thumbFolder + "\\")) { FileInfo inputFileInfo = new FileInfo(inputPath); mediaFile.FileSize = inputFileInfo.Exists ? inputFileInfo.Length : mediaFile.FileSize; } mediaFile.MediaLocation = inputPath; string outputPath = HttpContext.Current.Server.MapPath("~/" + _thumbFolder + "/" + WebRequestContext.Localization.Id + WebRequestContext.Localization.Path + System.IO.Path.ChangeExtension(mediaFile.FileName, ".jpg")); FileInfo fileInfo = new FileInfo(outputPath); if (!System.IO.File.Exists(outputPath)) { if (fileInfo.Directory != null && !fileInfo.Directory.Exists) { fileInfo.Directory.Create(); } if (!System.IO.File.Exists(inputPath)) { try { SiteConfiguration.ContentProvider.GetStaticContentItem(mediaFile.Url, WebRequestContext.Localization); } catch (Exception ex) { Log.Warn("No static content found: " + ex.StackTrace); } } } mediaFile.ThumbLocation = outputPath; string thumbPath = outputPath; if (!System.IO.File.Exists(outputPath)) { ThumbFactory thumb = new ThumbProvider(); IThumbGenerator thumbGenerator = thumb.GetThumbGenerator(mediaFile.MimeType); thumbPath = thumbGenerator.GetThumb(mediaFile); } if (thumbPath.Contains("/")) { mediaFile.GeneratedThumbImage = thumbPath; } else { FileInfo thumbfileInfo = new FileInfo(mediaFile.ThumbLocation); string imageUrl = thumbfileInfo.Exists ? WebRequestContext.Localization.Path + "/" + _thumbFolder + "/" + WebRequestContext.Localization.Id + WebRequestContext.Localization.Path + System.IO.Path.ChangeExtension(mediaFile.FileName, ".jpg") : "/thumbimages/default/thumbnail-pdf.jpg"; mediaFile.GeneratedThumbImage = imageUrl; } }
/// <summary> /// Create the thumbnail and enrich the view model. /// </summary> protected override ViewModel EnrichModel(ViewModel model) { using (new Tracer(model)) { MediaFileItem mediaFile = model as MediaFileItem; bool generateThumb = false; if (mediaFile != null && bool.TryParse(mediaFile.GenerateThumbnail, out generateThumb) && generateThumb) { ThumbModelHelper modelHelper = new ThumbModelHelper(); modelHelper.GenerateThumb(mediaFile); } return(mediaFile); } }
private void MediaState_ItemPropertiesChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (Items == null || Items.Count == 0) { return; } if (e.PropertyName.Equals("Location")) { lock (itemsLock) { if (BatchMode == false && Items.Count > 0) { MediaFileItem modifiedItem = sender as MediaFileItem; if (Items.ElementAt(0).Equals(modifiedItem)) { Filename = Path.GetFileNameWithoutExtension(modifiedItem.Location); Location = FileUtils.getPathWithoutFileName(modifiedItem.Location); } } } } else if (e.PropertyName.Equals("Metadata")) { lock (itemsLock) { if (BatchMode == false && Items.Count > 0) { MediaFileItem modifiedItem = sender as MediaFileItem; if (Items.ElementAt(0).Equals(modifiedItem)) { grabData(); } } } } else if (e.PropertyName.Equals("IsReadOnly")) { lock (itemsLock) { if (BatchMode == false && Items.Count > 0) { IsReadOnly = Items.ElementAt(0).IsReadOnly; } } } }
public void navigateToImageView(MediaFileItem item) { Uri imageViewUri = new Uri(typeof(MediaFileBrowserImagePanelView).FullName, UriKind.Relative); NavigationParameters navigationParams = new NavigationParameters(); navigationParams.Add("item", item); navigationParams.Add("viewModel", ImageViewModel); RegionManager.RequestNavigate(RegionNames.MediaFileBrowserContentRegion, imageViewUri, (result) => { CurrentViewModel = ImageViewModel; }, navigationParams); ImageMediaStackPanelViewModel.MediaStateCollectionView.FilterModes.MoveCurrentTo(MediaFilterMode.Images); Shell.ShellViewModel.navigateToMediaStackPanelView(imageMediaStackPanelViewModel, item != null ? item.Location : null); }
public void navigateToVideoView(MediaFileItem item) { Uri VideoViewUri = new Uri(typeof(VideoView).FullName, UriKind.Relative); NavigationParameters navigationParams = new NavigationParameters(); navigationParams.Add("item", item); navigationParams.Add("viewModel", VideoViewModel); RegionManager.RequestNavigate(RegionNames.MediaFileBrowserContentRegion, VideoViewUri, (result) => { CurrentViewModel = VideoViewModel; }, navigationParams); VideoMediaStackPanelViewModel.MediaStateCollectionView.FilterModes.MoveCurrentTo(MediaFilterMode.Video); Shell.ShellViewModel.navigateToMediaStackPanelView(videoMediaStackPanelViewModel, item.Location); }
/// <summary> /// Create thumbnail of pdf file /// </summary> /// <param name="mediaFile">pdf file object</param> public string GenerateThumb(MediaFileItem mediaFile) { using (new Tracer()) { try { if (!string.IsNullOrEmpty(mediaFile.ThumbLocation)) { GhostscriptWrapper.GeneratePageThumb(mediaFile.MediaLocation, mediaFile.ThumbLocation, 1, mediaFile.Width, mediaFile.Height); } } catch (Exception ex) { Log.Error(ex); } return(mediaFile.ThumbLocation); } }
public List <MediaFileItem> dbSearch(SearchQuery searchQuery) { using (MetadataDbCommands mediaCommands = new MetadataDbCommands()) { //mediaCommands.Db.Configuration.LazyLoadingEnabled = false; List <BaseMetadata> results = mediaCommands.findMetadataByQuery(searchQuery); List <MediaFileItem> items = new List <MediaFileItem>(); foreach (BaseMetadata result in results) { result.IsImported = true; MediaFileItem item = MediaFileItem.Factory.create(result.Location, result); items.Add(item); } return(items); } }
void grabData() { if (items.Count == 1 && Items.ElementAt(0).Metadata != null) { MediaFileItem media = Items.ElementAt(0); BaseMetadata metadata = media.Metadata; if (metadata.SupportsXMPMetadata == false) { clear(); } Filename = Path.GetFileNameWithoutExtension(metadata.Name); Location = metadata.Path; DynamicProperties.Clear(); if (metadata is ImageMetadata) { getImageProperties(DynamicProperties, metadata as ImageMetadata); } if (metadata is VideoMetadata) { getVideoProperties(DynamicProperties, metadata as VideoMetadata); } else if (metadata is AudioMetadata) { getAudioProperties(DynamicProperties, metadata as AudioMetadata); } Rating = metadata.Rating == null ? null : new Nullable <double>(metadata.Rating.Value / 5); Title = metadata.Title; Description = metadata.Description; Author = metadata.Author; Copyright = metadata.Copyright; Creation = metadata.CreationDate; IsImported = metadata.IsImported; IsReadOnly = media.IsReadOnly || !metadata.SupportsXMPMetadata || metadata is UnknownMetadata; Geotag = new GeoTagCoordinatePair(metadata.Latitude, metadata.Longitude); lock (tagsLock) { Tags.Clear(); foreach (Tag tag in metadata.Tags) { Tags.Add(tag); } } getExifProperties(DynamicProperties, metadata); SelectedMetaDataPreset = noPresetMetaData; IsEnabled = true; BatchMode = false; } else if (items.Count > 1 && BatchMode == true) { } else { if (items.Count > 1) { IsEnabled = true; BatchMode = true; IsReadOnly = false; clear(); } else if (items.Count == 0) { BatchMode = false; IsEnabled = false; IsReadOnly = true; IsRegexEnabled = false; clear(); } } }
bool updateMetadata(MediaFileItem item, MetaDataUpdateViewModelAsyncState state) { bool isModified = false; if (item.Metadata == null || item.Metadata is UnknownMetadata) { throw new Exception("Missing or invalid metadata in media"); } isModified = item.Metadata.IsModified; BaseMetadata media = item.Metadata; if (state.RatingEnabled) { Nullable <double> oldValue = media.Rating; media.Rating = state.Rating.HasValue == false ? null : state.Rating * 5; if (media.Rating != oldValue) { isModified = true; } } if (state.TitleEnabled && !EqualityComparer <String> .Default.Equals(media.Title, state.Title)) { media.Title = state.Title; isModified = true; } if (state.DescriptionEnabled && !EqualityComparer <String> .Default.Equals(media.Description, state.Description)) { media.Description = state.Description; isModified = true; } if (state.AuthorEnabled && !EqualityComparer <String> .Default.Equals(media.Author, state.Author)) { media.Author = state.Author; isModified = true; } if (state.CopyrightEnabled && !EqualityComparer <String> .Default.Equals(media.Copyright, state.Copyright)) { media.Copyright = state.Copyright; isModified = true; } if (state.CreationEnabled && !(Nullable.Compare <DateTime>(media.CreationDate, state.Creation) == 0)) { media.CreationDate = state.Creation; isModified = true; } if (state.IsGeoTagEnabled && !(Nullable.Compare <double>(media.Latitude, state.Latitude) == 0)) { media.Latitude = state.Latitude; isModified = true; } if (state.IsGeoTagEnabled && !(Nullable.Compare <double>(media.Longitude, state.Longitude) == 0)) { media.Longitude = state.Longitude; isModified = true; } if (state.BatchMode == false && !state.Tags.SequenceEqual(media.Tags)) { media.Tags.Clear(); foreach (Tag tag in state.Tags) { media.Tags.Add(tag); } isModified = true; } else if (state.BatchMode == true) { bool addedTag = false; bool removedTag = false; foreach (Tag tag in state.AddTags) { // Hashset compares items using their gethashcode function // which can be different for the same database entities created at different times if (!media.Tags.Contains(tag, EqualityComparer <Tag> .Default)) { media.Tags.Add(tag); addedTag = true; } } foreach (Tag tag in state.RemoveTags) { Tag removeTag = media.Tags.FirstOrDefault((t) => t.Name.Equals(tag.Name)); if (removeTag != null) { media.Tags.Remove(removeTag); removedTag = true; } } if (removedTag || addedTag) { isModified = true; } } return(isModified); }
void generatePreview(MediaFileItem item) { ItemProgressMax = 100; ItemProgress = 0; ItemInfo = "Creating video preview image for: " + System.IO.Path.GetFileName(item.Location); FileStream outputFile = null; RenderTargetBitmap bitmap = null; mediaProbe.open(item.Location, CancellationToken); try { int nrFrames = 0; if (asyncState.IsCaptureIntervalSecondsEnabled == false) { nrFrames = asyncState.NrRows * asyncState.NrColumns; } else { nrFrames = mediaProbe.DurationSeconds / asyncState.CaptureIntervalSeconds; nrFrames = calcNrRowsNrColumns(nrFrames); } int thumbWidth = asyncState.MaxPreviewImageWidth / asyncState.NrColumns; ItemProgressMax = nrFrames; double captureIntervalSeconds = asyncState.IsCaptureIntervalSecondsEnabled ? asyncState.CaptureIntervalSeconds : 0; List <MediaThumb> thumbs = mediaProbe.grabThumbnails(thumbWidth, 0, captureIntervalSeconds , nrFrames, 0.01, CancellationToken, 0, grabThumbnails_UpdateProgressCallback); if (thumbs.Count == 0 || CancellationToken.IsCancellationRequested) { return; } nrFrames = Math.Min(thumbs.Count, nrFrames); if (asyncState.IsCaptureIntervalSecondsEnabled == true) { nrFrames = calcNrRowsNrColumns(nrFrames); } JpegBitmapEncoder encoder = new JpegBitmapEncoder(); BitmapMetadata metaData = new BitmapMetadata("jpg"); metaData.ApplicationName = App.getAppInfoString(); metaData.DateTaken = DateTime.Now.ToString("R"); if (item.Metadata.Tags.Count > 0) { List <String> tags = new List <string>(); foreach (Tag tag in item.Metadata.Tags) { tags.Add(tag.Name); } metaData.Keywords = new ReadOnlyCollection <string>(tags); } if (item.Metadata.Title != null) { metaData.Title = item.Metadata.Title; } if (item.Metadata.Copyright != null) { metaData.Copyright = item.Metadata.Copyright; } if (item.Metadata.Description != null) { metaData.Subject = item.Metadata.Description; } if (item.Metadata.Author != null) { List <String> author = new List <string>(); author.Add(item.Metadata.Author); metaData.Author = new ReadOnlyCollection <string>(author); } if (item.Metadata.Rating != null) { metaData.Rating = (int)item.Metadata.Rating.Value; } // rendertargetbitmap has to be executed on the UI thread // if it's run on a non-UI thread there will be a memory leak App.Current.Dispatcher.Invoke(() => { VideoGridImage gridImage = new VideoGridImage(item.Metadata as VideoMetadata, asyncState, thumbs); bitmap = gridImage.createGridImage(asyncState.MaxPreviewImageWidth); }); BitmapFrame frame = BitmapFrame.Create(bitmap, null, metaData, null); encoder.Frames.Add(frame); String outputFileName = Path.GetFileNameWithoutExtension(item.Location) + ".jpg"; outputFile = new FileStream(asyncState.OutputPath + "/" + outputFileName, FileMode.Create); encoder.QualityLevel = asyncState.JpegQuality; encoder.Save(outputFile); ItemProgressMax = nrFrames; ItemProgress = nrFrames; InfoMessages.Add("Finished video preview image: " + asyncState.OutputPath + "/" + outputFileName); } catch (Exception e) { InfoMessages.Add("Error creating video preview image for: " + item.Location + " " + e.Message); Logger.Log.Error("Error creating preview image for: " + item.Location, e); } finally { if (bitmap != null) { bitmap.Clear(); bitmap = null; } if (outputFile != null) { outputFile.Close(); outputFile.Dispose(); } mediaProbe.close(); // because of the extreme amount of memory used by rendertargetbitmap // make sure we have it all back before moving on to prevent out of memory spikes GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); } }
public string GetThumb(MediaFileItem mediaFile) { return(_defaultThumbPath); }
private void selectedMediaDataGridView_RowDoubleClick(object sender, MediaFileItem e) { MediaFileBrowserViewModel.ExpandCommand.Execute(e); }
public string GenerateThumb(MediaFileItem mediaFile) { throw new NotImplementedException(); }
public string GetThumb(MediaFileItem mediaFile) { return(_powerpointThumbPath); }
public string GetThumb(MediaFileItem mediaFile) { return(_excelThumbPath); }
void insertEvent(FileSystemEventArgs e) { if (e == null) { return; } switch (e.ChangeType) { case WatcherChangeTypes.Changed: { if (Utils.MediaFormatConvert.isMediaFile(e.Name)) { MediaFileItem item = MediaFileItem.Factory.findInDictionary(e.FullPath); if (item != null) { changed.Add(item); } } break; } case WatcherChangeTypes.Created: { if (Utils.MediaFormatConvert.isMediaFile(e.Name)) { created.Add(MediaFileItem.Factory.create(e.FullPath)); } break; } case WatcherChangeTypes.Deleted: { if (Utils.MediaFormatConvert.isMediaFile(e.Name)) { MediaFileItem item = MediaFileItem.Factory.findInDictionary(e.FullPath); if (item != null) { // remove any changed events on files that will be deleted anyway changed.RemoveAll(t => t.Id == item.Id); removed.Add(item); } } break; } case WatcherChangeTypes.Renamed: { RenamedEventArgs r = e as RenamedEventArgs; if (Utils.MediaFormatConvert.isMediaFile(r.OldName) && !Utils.MediaFormatConvert.isMediaFile(r.Name)) { MediaFileItem oldItem = MediaFileItem.Factory.findInDictionary(r.OldFullPath); if (Path.GetExtension(r.Name).Equals("._01_")) { // Updating metadata on a mediafile will create a temporary copy of the mediafile // which causes several create/rename/delete events // ignore these events to prevent order of file locking problems in the UI } else { if (oldItem != null) { removed.Add(oldItem); } } } else if (!Utils.MediaFormatConvert.isMediaFile(r.OldName) && Utils.MediaFormatConvert.isMediaFile(r.Name)) { MediaFileItem newFile = MediaFileItem.Factory.create(r.FullPath); if (Path.GetExtension(r.OldName).Equals("._00_")) { // Updating metadata on a mediafile will create a temporary copy of the mediafile // which causes several create/rename/delete events // ignore these events to prevent order of file locking problems in the UI } else { created.Add(newFile); } } else if (Utils.MediaFormatConvert.isMediaFile(r.OldName) && Utils.MediaFormatConvert.isMediaFile(r.Name)) { MediaFileItem renamedItem = MediaFileItem.Factory.findInDictionary(r.OldFullPath); if (renamedItem != null) { renamedOldFiles.Add(renamedItem); renamedNewLocations.Add(r.FullPath); } } break; } } }