// Utility that grab all check within the scope or in sub scope included and check if everything is correct bool IsAllEntryCorrectInScope(InclusiveScope scope) { IEnumerable <Entry.Checker> checks = entries.Where(e => scope.Contains(e.scope)).Select(e => e.check); if (checks.Count() == 0) { return(true); } IEnumerator <Entry.Checker> enumerator = checks.GetEnumerator(); enumerator.MoveNext(); bool result = enumerator.Current(); if (enumerator.MoveNext()) { for (; result && enumerator.MoveNext();) { result &= enumerator.Current(); } } return(result); }
public static bool Contains(this InclusiveScope thisScope, InclusiveScope scope) => ((~thisScope) & scope) == 0;