private void EditSizeCor(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog { Multiselect = true, Filter = "PDF (*.pdf)|*.pdf" }; if (openFileDialog.ShowDialog() == true) { DataClass d = ((FrameworkElement)sender).DataContext as DataClass; foreach (string filename in openFileDialog.FileNames) { d.SizeCorAdd(PdfProcessing.ProcessFile(filename)); } } }
public void AddData(IEnumerable <string> paths) { foreach (string file in paths) { DataClass d = new DataClass(); if (Directory.Exists(file)) { d.DocCode = new DirectoryInfo(file).Name; d.Size = PdfProcessing.ProcessFolder(file, Recursive); } else if (File.Exists(file)) { d.DocCode = System.IO.Path.GetFileNameWithoutExtension(file); d.Size = PdfProcessing.ProcessFile(file); } d.Link = System.IO.Path.GetDirectoryName(file); Data.Add(d); } }