/// <summary> /// Refreshes the current view of files /// </summary> /// <param name="allFiles">Clears down all files to be refreshed</param> public void Refresh(bool allFiles) { if (CurrentFileList != null) { CurrentFileList.Clear(); } if (allFiles) { if (AllFiles != null) { AllFiles.Clear(); } SelectedFile = null; } if (SelectedFile == null) { OnLoadData(); } else { SelectedFile.Children = null; ExpandFile(SelectedFile); } }
private void GenerateFiles() { AllFiles.Clear(); foreach (var file in _fileRenamerModel.Files) { AllFiles.Add(new FileViewModel(file)); } }
public void ResetProjectSettings() { AllFiles.Clear(); destinationPath = ""; styleName = "OrteliusAjax"; docXmlFileName = "/ortelius.xml"; docHtmlFileName = "/index.html"; introText = ""; introHeader = ""; showAfterBuild = false; language = 0; }
public override void Preload() { AllFiles.Clear(); filesList.Clear(); // Load the index file. indexFile = ReadFile(INDEX_FILENAME); if (indexFile == null) { Configs.LogError($"Index file is missing at Resources path {INDEX_FILENAME}."); return; } // Load all the files. foreach (var nameNode in indexFile.Parsed.Values) { string filename = nameNode.StringValue; filesList.Add(filename); if (filename != "index") { AllFiles[filename] = ReadFile(filename); } } }
protected void OnImageOpenButtonClicked(object sender, EventArgs e) { try { if (!IsBusy() && checkPrograms()) { FileChooserDialog fc = new FileChooserDialog("Open Images", this, FileChooserAction.SelectFolder, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept); if (Directory.Exists(MySettings.LastPicDir)) { fc.SetCurrentFolder(MySettings.LastPicDir); } if (fc.Run() == (int)ResponseType.Accept) { #region Get all supported images List <string> Files = new List <string>(); Files.AddRange(Directory.GetFiles(fc.Filename, "*.jpg", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.jpeg", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.CR2", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.CRW", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.png", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.tif", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.tiff", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.x3f", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.NEF", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.srw", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.srf", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.sr2", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.arw", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.erf", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.pef", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.raf", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.3fr", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.fff", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.dcr", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.dcs", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.kdc", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.rwl", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.mrw", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.mdc", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.nrw", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.orf", SearchOption.TopDirectoryOnly)); Files.AddRange(Directory.GetFiles(fc.Filename, "*.rw2", SearchOption.TopDirectoryOnly)); #endregion if (Files.Count > 1) { AllFiles.Clear(); if (BrightnessCalculated) { AllCurves.BrInCurve = null; BrightnessCalculated = false; GCurves.GCurve tmp; AllCurves.Curves.TryGetValue(GCurves.CurveName.Exposure_Compensation.ToString(), out tmp); tmp.ClearPoints(); } deleteThumbs(); Workpath = fc.Filename; MySettings.LastPicDir = fc.Filename; MySettings.Save(); for (int i = 0; i < Files.Count; i++) { AllFiles.Add(new FileData(Files[i])); if (PPfileOpened) { AllFiles[i].PP3 = new PP3Values(MainPP3.Path); } else { AllFiles[i].PP3 = new PP3Values(); } } if (PPfileOpened) { AllFiles[0].IsKeyframe = true; } PrevIndexSpin.Adjustment.Upper = AllFiles.Count - 1; PrevCountSpin.Adjustment.Upper = AllFiles.Count - PrevIndexSpin.Value + 1; UpdateTable(); GetExifData(); SetSaveStatus(false); } else { UpdateInfo(InfoType.Imagecount, 0); } } fc.Destroy(); } } catch (Exception ex) { ReportError("Browse Pictures", ex); BrightnessCalculated = false; } }