Beispiel #1
0
 public virtual dynamic GetPropertyValue(string propertyName)
 {
     return(MsBuildProject.GetPropertyValue(propertyName));
 }
        private IReadOnlyDictionary <string, IProjectProperty> ProcessProperties(IEnumerable <ProjectPropertyElement> propertyElements)
        {
            var result = new Dictionary <string, ProjectProperty>();

            foreach (var propertyElement in propertyElements)
            {
                ProjectProperty property;

                if (!result.TryGetValue(propertyElement.Name, out property))
                {
                    property = result[propertyElement.Name] = new ProjectProperty(propertyElement.Name, MsBuildProject.GetPropertyValue(propertyElement.Name));
                }

                property.Add(new ProjectPropertyOccurrence(propertyElement));
            }

            return(new ReadOnlyDictionary <string, IProjectProperty>(result.ToDictionary(x => x.Key, x => (IProjectProperty)x.Value)));
        }