public EntryTypeDef(string name, IEnumerable<string> classes, EntryTypeDefFilter filter) { Name = name; _classes = new HashSet<string>(); foreach (var c in classes) _classes.Add(c); Filter = filter; }
public bool Test(RantDictionaryEntry entry) { if (!EntryTypeDefFilter.Test(Filter, entry)) { return(true); } return(entry.GetClasses().Where(IsValidValue).Count() == 1); }
public EntryTypeDef(string name, IEnumerable <string> classes, EntryTypeDefFilter filter) { Name = name; _classes = new HashSet <string>(); foreach (var c in classes) { _classes.Add(c); } Filter = filter; }
/// <summary> /// Determines whether a type should apply to the specifed entry according to the specified filter. /// </summary> /// <param name="filter">The filter to test with.</param> /// <param name="entry">The entry to test.</param> /// <returns></returns> public static bool Test(EntryTypeDefFilter filter, RantDictionaryEntry entry) => filter?.DoTest(entry) ?? false;