public void ClearStates() { foreach (var stateUsage in StateUsages.ToList()) { stateUsage.Delete(); } }
public void AttachState(StateDefinition state) { ArgumentUtility.CheckNotNull("state", state); StateUsage stateUsage = StateUsage.NewObject(); stateUsage.StateDefinition = state; StateUsages.Add(stateUsage); }
public bool MatchesStates(IList <StateDefinition> states) { ArgumentUtility.CheckNotNullOrItemsNull("states", states); if (StateUsages.Count == 0 && states.Count > 0) { return(false); } return(StateUsages.Select(stateUsage => stateUsage.StateDefinition).All(usedState => states.Contains(usedState))); }
public StateDefinition[] GetStates() { return(StateUsages.Select(stateUsage => stateUsage.StateDefinition).ToArray()); }