コード例 #1
0
 private ProjectPropertyElement?FindDimensionProperty(IEnumerable <ProjectPropertyElement> properties)
 {
     // NOTE: We try to somewhat mimic evaluation, but it doesn't have to be exact; its just a guess
     // at what "might" be the default configuration, not what it actually is.
     return(properties.Reverse()
            .FirstOrDefault(
                p => StringComparers.PropertyNames.Equals(PropertyName, p.Name) &&
                BuildUtilities.HasWellKnownConditionsThatAlwaysEvaluateToTrue(p)));
 }
 private ProjectPropertyElement FindDimensionProperty(ProjectRootElement projectXml)
 {
     // NOTE: We try to somewhat mimic evaluation, but it doesn't have to be exact; its just a guess
     // at what "might" be the default configuration, not what it actually is.
     return(projectXml.PropertyGroups.SelectMany(group => group.Properties)
            .Reverse()
            .Where(p => StringComparers.PropertyNames.Equals(PropertyName, p.Name))
            .Where(p => BuildUtilities.HasWellKnownConditionsThatAlwaysEvaluateToTrue(p))
            .FirstOrDefault());
 }