コード例 #1
0
        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);
        }
コード例 #2
0
 /// <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;
コード例 #3
0
 /// <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;