private void ModExplorer_RequestFileOpen(object sender, RequestFileArgs e) { var fullpath = Path.Combine(ActiveMod.FileDirectory, e.File); var ext = Path.GetExtension(fullpath); switch (ext) { case ".csv": case ".xml": case ".txt": ShellExecute(fullpath); break; case ".subs": PolymorphExecute(fullpath, ".txt"); break; case ".usm": MessageBox.Show(@"These are the movie files of The Witcher 3. You need a Video demultiplexer to convert these files to usable ones. I recommend: https://sourceforge.net/projects/vgmtoolbox/", @"Info", MessageBoxButtons.OK, MessageBoxIcon.Information); break; default: LoadDocument(fullpath); break; } }
private void ModExplorer_RequestFileOpen(object sender, RequestFileArgs e) { var fullpath = Path.Combine(ActiveMod.FileDirectory, e.File); var ext = Path.GetExtension(fullpath); switch (ext) { case ".csv": case ".xml": case ".txt": ShellExecute(fullpath); break; case ".subs": PolymorphExecute(fullpath, ".txt"); break; case ".usm": LoadUsmFile(fullpath); break; default: LoadDocument(fullpath); break; } }
private void ModExplorer_RequestFileDelete(object sender, RequestFileArgs e) { var filename = e.File; if ( MessageBox.Show("Are you sure you want to permanently delete this?", "Confirmation", MessageBoxButtons.OKCancel) == DialogResult.OK) { removeFromMod(filename); } }
private void ModExplorer_RequestFileRename(object sender, RequestFileArgs e) { var filename = e.File; var fullpath = Path.Combine(ActiveMod.FileDirectory, filename); if (!File.Exists(fullpath)) { return; } var dlg = new frmRenameDialog(); dlg.FileName = filename; if (dlg.ShowDialog() == DialogResult.OK && dlg.FileName != filename) { var newfullpath = Path.Combine(ActiveMod.FileDirectory, dlg.FileName); if (File.Exists(newfullpath)) { return; } // Rename file in file structure try { Directory.CreateDirectory(Path.GetDirectoryName(newfullpath)); } catch { } File.Move(fullpath, newfullpath); // Rename file in mod explorer if (ModExplorer != null) { ModExplorer.DeleteNode(filename); ModExplorer.UpdateModFileList(true, true); } } }
private void ModExplorer_RequestAddFile(object sender, RequestFileArgs e) { addModFile(false, e.File); }