Example #1
0
 public static IProjectSection Create(ProjectSectionType sectionType)
 {
     return(sectionType switch
     {
         ProjectSectionType.SolutionItems => new SolutionItemsSection(),
         ProjectSectionType.ProjectDependencies => new ProjectDependenciesSection(),
         _ => throw new Exception($"Unknown project section type : {sectionType}"),
     });
        private void WriteProjectSection(ProjectSectionType sectionType, Project project, StringBuilder result, string loadingOrder)
        {
            var projectSection = ProjectSectionTypeFactory.Create(sectionType);

            if (projectSection.Exists(project))
            {
                result.AppendLine($"\tProjectSection({sectionType}) = {loadingOrder}");

                projectSection.Serialize(project, result);

                result.AppendLine("\tEndProjectSection");
            }
        }
Example #3
0
        private string Render(ProjectSectionType type)
        {
            switch (type)
            {
            case ProjectSectionType.PostProject:
                return("postProject");

            case ProjectSectionType.PreProject:
                return("preProject");

            default:
                throw new ArgumentOutOfRangeException("type", type, null);
            }
        }
Example #4
0
        private static string _Format(ProjectSectionType type)
        {
            switch (type)
            {
            case ProjectSectionType.PostProject:
                return("postProject");

            case ProjectSectionType.PreProject:
                return("preProject");

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Example #5
0
 public ProjectSection(string name, ProjectSectionType sectionType)
 {
     Name    = name;
     Type    = sectionType;
     Entries = new Dictionary <string, string>();
 }
        private void ParseProjectSection(ProjectSectionType sectionType, TokenWalker tokenWalker, Project project)
        {
            var projectSection = ProjectSectionTypeFactory.Create(sectionType);

            projectSection.Parse(tokenWalker, project);
        }
 public ProjectSection(string name, ProjectSectionType sectionType)
 {
     Name = name;
     Type = sectionType;
     Entries = new Dictionary<string, string>();
 }