コード例 #1
0
 public void ClearStates()
 {
     foreach (var stateUsage in StateUsages.ToList())
     {
         stateUsage.Delete();
     }
 }
コード例 #2
0
        public void AttachState(StateDefinition state)
        {
            ArgumentUtility.CheckNotNull("state", state);
            StateUsage stateUsage = StateUsage.NewObject();

            stateUsage.StateDefinition = state;
            StateUsages.Add(stateUsage);
        }
コード例 #3
0
        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)));
        }
コード例 #4
0
 public StateDefinition[] GetStates()
 {
     return(StateUsages.Select(stateUsage => stateUsage.StateDefinition).ToArray());
 }