public override IMyGenDocument Open(IMyGenerationMDI mdi, FileInfo file, params string[] args) { ProjectBrowser edit = null; if (file.Exists) { bool isopen = mdi.IsDocumentOpen(file.FullName); if (!isopen) { edit = new ProjectBrowser(mdi); edit.LoadProject(file.FullName); } else { edit = mdi.FindDocument(file.FullName) as ProjectBrowser; if (edit != null) { edit.Activate(); } } } return edit; }
public override IMyGenDocument Open(IMyGenerationMDI mdi, FileInfo file, params string[] args) { ProjectBrowser edit = null; if (file.Exists) { bool isopen = mdi.IsDocumentOpen(file.FullName); if (!isopen) { edit = new ProjectBrowser(mdi); edit.LoadProject(file.FullName); } else { edit = mdi.FindDocument(file.FullName) as ProjectBrowser; if (edit != null) { edit.Activate(); } } } return(edit); }
public override IMyGenDocument Create(IMyGenerationMDI mdi, params string[] args) { ProjectBrowser edit = new ProjectBrowser(mdi); switch (args[0]) { case ProjectEditorManager.MYGEN_PROJECT: default: edit.CreateNewProject(); break; } return(edit); }
public override IMyGenDocument Create(IMyGenerationMDI mdi, params string[] args) { ProjectBrowser edit = new ProjectBrowser(mdi); switch (args[0]) { case ProjectEditorManager.MYGEN_PROJECT: default: edit.CreateNewProject(); break; } return edit; }
private ProjectBrowser OpenProjectEditor(string filename) { ProjectBrowser proj = null; bool isopen = IsProjectOpen(filename); if (!isopen) { proj = new ProjectBrowser(this); proj.LoadProject(filename); proj.Show(dockManager); } return proj; }
private ProjectBrowser OpenProjectEditor() { ProjectBrowser proj = new ProjectBrowser(this); proj.CreateNewProject(); proj.Show(dockManager); return proj; }
public ProjectBrowser GetProjectBrowser(string filename, ProjectBrowser exclude) { ProjectBrowser editor = null; FileInfo inf = new FileInfo(filename); string tmp = inf.FullName; foreach (DockContent cont in dockManager.Contents) { if ((cont is ProjectBrowser) && (cont != exclude)) { editor = cont as ProjectBrowser; if (tmp.ToUpper() == editor.CompleteFilePath.ToUpper()) { break; } else { editor = null; } } } return editor; }
public bool IsProjectOpen(string filename, ProjectBrowser exclude) { ProjectBrowser editor = GetProjectBrowser(filename, exclude); return (editor != null); }