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"); } }
private string Render(ProjectSectionType type) { switch (type) { case ProjectSectionType.PostProject: return("postProject"); case ProjectSectionType.PreProject: return("preProject"); default: throw new ArgumentOutOfRangeException("type", type, null); } }
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); } }
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>(); }