private void UpdateFiles(FileEntry file) { if(fileManager == null) return; if(!file.IsDirectory) { ViewerForm viewer = new ViewerForm(file.FormattedName, fileManager.ReadFileAsString(file)); viewer.Owner = this; viewer.Show(); return; } try { fileManager.ChangeDirectory(file.FormattedName); } catch(DirectoryNotFoundException) { MessageBox.Show(this, "Directory does not exist.", "Undelete"); } RefreshFiles(); }
private void ExamineFile(FileEntry file) { if(fileManager == null) return; if(!file.IsFile) return; ViewerForm viewer = new ViewerForm(file.FormattedName, fileManager.ReadFileAsString(file)); viewer.Owner = this; viewer.Show(); }
private bool RestoreFile(FileEntry file) { if(fileManager == null) return false; if(!file.IsFile) return true; string fileName = file.FormattedName; if(fileName[0] == '?') fileName = '!' + ((fileName.Length > 1) ? (fileName.Substring(1)) : ("")); dlgSaveFile.FileName = fileName; if(dlgSaveFile.ShowDialog(this) == DialogResult.Cancel) return false; FileStream fs = File.Create(dlgSaveFile.FileName); fileManager.SaveFile(file, fs); fs.Close(); return true; }