public void AddConfiguration(string name, string when, string config, string value) { if (Configuration == null) Configuration = new NameValueItem() { Name = name, When = when }; Configuration.AddItem(config, value); }
private Solution CreateSolution(SolutionDocument document) { var solution = new Solution() { Version = document.FileVersion, VisualStudioVersion = document.VisualStudioVersion }; if (document.Info.Any()) { solution.Headers = new List<NameValue>(); foreach (var info in document.Info) solution.Headers.Add(new NameValue { Name = info.Key, Value = info.Value }); } var ignored = new[] { "ProjectConfigurationPlatforms", "NestedProjects" }; foreach (var globalSection in document.GlobalSections.Where(p => !ignored.Contains(p.Name))) { if (!globalSection.Info.Any()) continue; var sectionItem = new NameValueItem { Name = globalSection.Name, When = globalSection.When }; foreach (var item in globalSection.Info) sectionItem.AddItem(item.Key, item.Value); solution.Sections.Add(sectionItem); } return solution; }
public void AddConfiguration(string name, string when, string config, string value) { if (Configuration == null) { Configuration = new NameValueItem() { Name = name, When = when } } ; Configuration.AddItem(config, value); }