protected override IMSBuildGlob CreateMsBuildGlob() { if (ReferencedItems.Count == 1) { // Optimize the common case, avoiding allocation of enumerable/enumerator. return(ReferencedItems[0].ItemAsValueFragment.ToMSBuildGlob()); } return(CompositeGlob.Create(ReferencedItems.Select(i => i.ItemAsValueFragment.ToMSBuildGlob()))); }
public override bool IsMatchOnMetadata(IItem item, IEnumerable <string> metadata, MatchOnMetadataOptions options) { return(ReferencedItems.Any(referencedItem => metadata.All(m => !item.GetMetadataValue(m).Equals(string.Empty) && MetadataComparer(options, item.GetMetadataValue(m), referencedItem.Item.GetMetadataValue(m))))); }
public override bool IsMatch(string itemToMatch) { return(ReferencedItems.Any(v => v.ItemAsValueFragment.IsMatch(itemToMatch))); }
public override int MatchCount(string itemToMatch) { return(ReferencedItems.Count(v => v.ItemAsValueFragment.MatchCount(itemToMatch) > 0)); }
protected override IMSBuildGlob CreateMsBuildGlob() { return(new CompositeGlob(ReferencedItems.Select(i => i.ItemAsValueFragment.ToMSBuildGlob()))); }
public override IEnumerable <string> GetReferencedItems() { return(ReferencedItems.Select(v => EscapingUtilities.UnescapeAll(v.ItemAsValueFragment.TextFragment))); }