public void AttachBehavior(IQueueBehavior <T> behavior) { if (behavior != null) { _behaviors.Add(behavior); } behavior?.Attach(this); }
public void AttachBehavior(IQueueBehavior <T> behavior) { if (behavior == null) { return; } _behaviors.Add(behavior); behavior.Attach(this); }
public TBuilder AddBehavior(IQueueBehavior <T> behavior) { if (behavior == null) { throw new ArgumentNullException(nameof(behavior)); } if (Target.Behaviors == null) { Target.Behaviors = new List <IQueueBehavior <T> > (); } Target.Behaviors.Add(behavior); return((TBuilder)this); }