public ISolutionFileItem AddFile(FileName fileName)
        {
            var newItem = new SolutionFileItem(parentSolution);

            newItem.FileName = fileName;
            this.Items.Add(newItem);
            return(newItem);
        }
        SolutionFolder CreateSolutionFolder(Solution solution, ProjectLoadInformation information)
        {
            var folder = new SolutionFolder(solution, information.IdGuid);

            folder.Name = information.ProjectName;
            // Add solution items:
            var solutionItemsSection = information.ProjectSections.FirstOrDefault(s => s.SectionName == "SolutionItems");

            if (solutionItemsSection != null)
            {
                foreach (string location in solutionItemsSection.Values)
                {
                    var fileItem = new SolutionFileItem(solution);
                    fileItem.FileName = FileName.Create(Path.Combine(information.Solution.Directory, location));
                    folder.Items.Add(fileItem);
                }
            }
            return(folder);
        }
Exemple #3
0
		SolutionFolder CreateSolutionFolder(Solution solution, ProjectLoadInformation information)
		{
			var folder = new SolutionFolder(solution, information.IdGuid);
			folder.Name = information.ProjectName;
			// Add solution items:
			var solutionItemsSection = information.ProjectSections.FirstOrDefault(s => s.SectionName == "SolutionItems");
			if (solutionItemsSection != null) {
				foreach (string location in solutionItemsSection.Values) {
					var fileItem = new SolutionFileItem(solution);
					fileItem.FileName = FileName.Create(Path.Combine(information.Solution.Directory, location));
					folder.Items.Add(fileItem);
				}
			}
			return folder;
		}