private static List <CacheFile> GetCacheFiles(string gaDir, ChromosomeRenamer renamer) { var ndbFiles = Directory.GetFiles(gaDir, "*.ndb"); var cacheFiles = new List <CacheFile>(); foreach (var ndbPath in ndbFiles) { var cacheFile = CacheFile.Create(ndbPath, renamer); if (cacheFile.Type == MiniCacheType.Unknown) { continue; } cacheFiles.Add(cacheFile); } return(cacheFiles); }
private void ImageButton_Click(object sender, RoutedEventArgs e) { //TODO: if important...... use impersonation to get network drives visibility var dlg = new Microsoft.Win32.OpenFileDialog { // Set filter for file extension and default file extension DefaultExt = ".png", Filter = "Image Files |*.jpeg; *.jpg; *.png; *.gif; *.bmp" }; // Display OpenFileDialog by calling ShowDialog method var result = dlg.ShowDialog(); // Get the selected file name and display in a TextBox if (result == true) { _fileName = CacheFile.Create(dlg.FileName); _selectedImagePath = Path.GetFullPath($@"Cache\{_fileName}"); EmbedImage.Source = new BitmapImage(new Uri(_selectedImagePath)); } }