private void mainFrm_Load(object sender, EventArgs e) { DataManager.initDataManager(); AutoCompleteItemManager.load(); if (DataManager.settings.openedPersonas.Count > 0) { foreach (string personaPath in DataManager.settings.openedPersonas) { OpenPersonaIgnoreChecks(personaPath); } } foreach (string filePath in DataManager.settings.openedTabs) { OpenableFile file = findFileInTree(this.projectView.Nodes, filePath); if (file == null) { file = PersonaFile.CreateInstance(filePath); } openFileIgnoreChecks(file); } this.recentlyOpenedScriptsToolStripMenuItem.Entries = DataManager.settings.last10OpenedScripts; this.recentlyOpenedPersonalitiesToolStripMenuItem.Entries = DataManager.settings.last10OpenedPersonas; this.toolStripMakroBtnRecord.Enabled = false; this.toolStripMakroBtnExecute.Enabled = false; //TODO: enable in later version after implementation }
private void openScript_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = DataManager.settings.lastOpenedSingleFileDirectory; if (ofd.ShowDialog() == DialogResult.OK) { PersonaFile newFile = PersonaFile.CreateInstance(ofd.FileName); openFile(newFile); DataManager.settings.lastOpenedSingleFileDirectory = newFile.File.Directory.FullName; } }
public Folder(DirectoryInfo dir) { this.Directory = dir; foreach (DirectoryInfo subDir in this.Directory.GetDirectories()) { this.Folders.Add(subDir.Name, new Folder(subDir)); } foreach (FileInfo file in this.Directory.GetFiles()) { PersonaFile newFile = PersonaFile.CreateInstance(file); this.Files.Add(file.Name, newFile); } }
public frmMain() { InitializeComponent(); this.projectView.ImageList = DataManager.iconList; //this.renameToolStripMenuItem.Enabled = false; this.recentlyOpenedScriptsToolStripMenuItem.EntryClicked += (object sender, EventArgs e) => { ToolStripMenuItem menuItem = (ToolStripMenuItem)sender; OpenableFile file = PersonaFile.CreateInstance(menuItem.Text); openFile(file); }; this.recentlyOpenedPersonalitiesToolStripMenuItem.EntryClicked += (object sender, EventArgs e) => { ToolStripMenuItem menuItem = (ToolStripMenuItem)sender; OpenPersona(menuItem.Text); }; }
private void newScriptToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.InitialDirectory = ((Folder)this.projectView.SelectedNode.Tag).Directory.FullName; if (sfd.ShowDialog() == DialogResult.OK) { PersonaFile file = PersonaFile.CreateInstance(sfd.FileName); file.Persona = ((Folder)this.projectView.SelectedNode.Tag)?.Persona; //if persona is set in parent folder set it to the new file too File.Create(file.File.FullName).Close(); this.addAssociatedFile(file, this.projectView.SelectedNode); openFile(file); } }
public static PersonaFile CreateInstance(string path) { return(PersonaFile.CreateInstance(new FileInfo(path))); }