public Project(IManager manager) { mManager = manager; mRootItem = new RootItem(this); mProjectName = "New Project"; mUserDocument = CreateEmptyUserDocument(); mUserOptionsDatabase = new XmlOptionsDatabase((XmlElement) mUserDocument.SelectSingleNode("UserConfiguration")); }
public Project(IManager manager, string fileName) { mManager = manager; mRootItem = new RootItem(this); mProjectName = Path.GetFileName(fileName); mUserDocument = LoadUserConfig(fileName); mUserOptionsDatabase = new XmlOptionsDatabase((XmlElement)mUserDocument.SelectSingleNode("UserConfiguration")); XmlElement vcsConfig = GetUserConfigurationXML("VersionControl"); if (vcsConfig != null) { Type vcsType = ReflectionUtils.FindType(vcsConfig.GetAttribute("type")); if (vcsType != null) { XmlSerializer serializer = new XmlSerializer(vcsType); XmlReader reader = new XmlNodeReader(vcsConfig.FirstChild); VCS = (IVersionController)serializer.Deserialize(reader); } } // XmlElement vcsConfig = GetUserConfigurationXML("VersionControl"); // Type vcsType = null; // if (vcsConfig != null) // vcsType = ReflectionUtils.FindType(vcsConfig.GetAttribute("type")); // // if (vcsType != null) // { // XmlSerializer serializer = new XmlSerializer(vcsType); // XmlReader reader = new XmlNodeReader(vcsConfig.FirstChild); // VCS = (IVersionController) serializer.Deserialize(reader); // } // else // { // System.Windows.Forms.MessageBox.Show("Would you like to configure source control for this project?"); // } }