public bool RemoveBehavior(CoreBehavior behavior) { // Remove behavior from list of CoreBehaviors if behavior is not null && does not already exist in the list. if (behavior != null && ActiveBehaviors.FirstOrDefault(obj => obj == behavior) != null) { ActiveBehaviors.Remove(behavior); return(true); } return(false); }
public bool AddBehavior(CoreBehavior behavior) { // Add behavior to list of CoreBehaviors if behavior is not null && does not already exist in the list. if (behavior != null && ActiveBehaviors.FirstOrDefault(obj => obj == behavior) == null) { ActiveBehaviors.Add(behavior); return(true); } return(false); }