/// <summary> /// Returns a new <see cref="BehaviorChainTemplate"/> with a behavior /// chain item template added to the end of the item template list of /// this behavior chain template. /// </summary> /// <param name="state"> /// If 'Disabled', the behavior is not enabled in a <see cref="BehaviorChainConfiguration"/> /// created from this template. This means it will not be included in the finally /// created <see cref="BehaviorChain"/> unless <see cref="BehaviorChainConfiguration.Enable"/> /// is called. /// </param> public BehaviorChainTemplate Append( BehaviorKey key, DefaultBehaviorState state = DefaultBehaviorState.Enabled ) { Check.NotNull(key, nameof(key)); var itemTemplatesClone = new List <BehaviorChainItemTemplate>(_itemTemplates); itemTemplatesClone.Add(new BehaviorChainItemTemplate(key, state)); return(new BehaviorChainTemplate(_factoryProvider, itemTemplatesClone)); }
public BehaviorChainItemTemplate(BehaviorKey key, DefaultBehaviorState state) { _key = key; _state = state; }