Beispiel #1
0
        public void ValidateStateCombinationsAgainstStateProperties(SecurableClassValidationResult result)
        {
            Assertion.IsTrue(
                State != StateType.Deleted || StateCombinations.Count == 0, "StateCombinations of object '{0}' are not empty but the object is deleted.", ID);

            foreach (var stateCombination in StateCombinations.Where(sc => sc.GetStates().Length != StateProperties.Count))
            {
                result.AddInvalidStateCombination(stateCombination);
            }
        }
Beispiel #2
0
 public StateCombination FindStateCombination(IList <StateDefinition> states)
 {
     return(StateCombinations.Where(sc => sc.MatchesStates(states)).SingleOrDefault());
 }