public void createProject(String name, String scenario, String location, String swattLocation, SwattProject.ProjectVersion apexVersion, SwattProject.ProjectVersion swattVersion) { // create project and add it to the store. this.Current = name; var project = new SwattProject(); project.Name = this.Current; project.Location = location + @"\" + project.Name; project.CurrentScenario = scenario; project.SwattLocation = swattLocation; project.ApexVersion = apexVersion; project.SwattVersion = swattVersion; // TODO: Add database connection projectMapping.Add(this.Current, project); try { // insert project into project path table if (!dbManager.setProjectPath(project)) { throw new ProjectException("Couldn't update project path in database"); } //this.readFigFile(); this.writeProject(project.Location); CEEOTDLLManager.initializeGlobals(this); } catch (Exception ex) { throw new ProjectException("Couldn't update project path in database" + ex.Message); } }
public void readProject(String path) { System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(SwattProject)); System.IO.StreamReader file = new System.IO.StreamReader(path + @"\project.xml"); SwattProject proj = (SwattProject)reader.Deserialize(file); this.Current = proj.Name; // TODO: Add database connection this.projectMapping.Add(this.Current, proj); this.loadSubBasins(); CEEOTDLLManager.initializeGlobals(this); file.Close(); }