private static string GetValue(IEnumerable <string> keyList, TagCollection tags) { string value; foreach (var key in keyList) { if (tags.TryGetValue(key, out value)) { return(value); } } return(null); }
/// <summary> /// Returns true if <see cref="EqualsTagFilter.Key" /> is present in <paramref name="collection" /> and <see cref="EqualsTagFilter.Value" /> equals to <paramref name="collection" /> value by this <see cref="EqualsTagFilter.Key" />. /// </summary> public bool Matches(TagCollection collection) => collection != null && collection.TryGetValue(Key, out var value) && value == Value;
/// <summary> /// Returns true if <see cref="EqualsTagFilter.Key" /> is present in <paramref name="collection" /> and <see cref="EqualsTagFilter.Value" /> not equals to <paramref name="collection" /> value by this <see cref="EqualsTagFilter.Key" />. /// </summary> public bool Matches(TagCollection collection) => collection == null || !collection.TryGetValue(Key, out var value) || value != Value;