static public OptionsSettings Instance() { if (_instance == null) { _instance = new OptionsSettings(); } return(_instance); }
public void LoadProjectFile(string filename, bool solution_as_project) { XmlDocument d = new XmlDocument(); try { d.Load(filename); string solution_f = ""; XmlNode location = d.SelectSingleNode("project/solutionfilename"); if (location != null) { solution_f = location.InnerText; } else { solution_f = d.SelectSingleNode("project/solution").InnerText; } string projectdir = System.IO.Path.GetDirectoryName(filename); if (solution_f.StartsWith(".")) { // it is a relative path, relative to the projectfile's location solution_f = Utility.TemplateUtil.Instance().CombineAndCompact(projectdir, solution_f); } LoadSolutionFile(solution_f, solution_as_project); OptionsSettings.Instance().RegisterLastUsedProject(filename, solution_f); //this.Text += ": " + Path.GetFileNameWithoutExtension(filename); if (!solution_as_project) { m_project_directory = projectdir; m_project_file = filename; } } catch (Exception ex) { throw new ApplicationException("Exception occured during load of projectfile '" + filename + "'. " + ex.Message); } }