예제 #1
0
        /// <summary>
        ///     Initialises a new <see cref="Project" /> instance.
        /// </summary>
        public Project(ProjectSolution solution)
        {
            // Link the project and the solution
            _solution = solution;
            if (!_solution.Projects.Contains(this))
            {
                _solution.Projects.Add(this);
            }

            // Ensure the project file exists
            if (!Directory.Exists(this.ProjectFolder))
            {
                Directory.CreateDirectory(this.ProjectFolder);
            }
            if (!File.Exists(this.FilePath))
            {
                this.Initialise();
            }

            // Load the project document
            _xmlDocument = new XmlDocument();
            _xmlDocument.Load(this.FilePath);

            // Initialise the project document namespace
            _xmlManager = new XmlNamespaceManager(_xmlDocument.NameTable);
            _xmlManager.AddNamespace("vs", Project.VsNamespace);
        }
예제 #2
0
 /// <summary>
 ///     Initialises a new <see cref="ProjectCSharp"/> instance.
 /// </summary>
 /// <param name="solution">
 ///     Sets the parent solution within which, the project is location.
 /// </param>
 public ProjectCSharp(ProjectSolution solution) : base(solution)
 {
 }