Show / Hide Table of Contents

Class BehaviorContainer.BehaviorContainerBuilder<TContext>

Default implementation of the IBehaviorContainerBuilder<TContext>.

Inheritance
object
BehaviorContainer.BehaviorContainerBuilder<TContext>
Implements
IBehaviorContainerBuilder<TContext>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SpiceSharp.Behaviors
Assembly: SpiceSharp.dll
Syntax
protected class BehaviorContainer.BehaviorContainerBuilder<TContext> : IBehaviorContainerBuilder<TContext> where TContext : IBindingContext
Type Parameters
Name Description
TContext

The type of binding context.

Constructors

BehaviorContainerBuilder(IBehaviorContainer, ISimulation, TContext)

Initializes a new instance of the BehaviorContainer.BehaviorContainerBuilder<TContext> class.

Declaration
public BehaviorContainerBuilder(IBehaviorContainer container, ISimulation simulation, TContext context)
Parameters
Type Name Description
IBehaviorContainer container

The container.

ISimulation simulation

The simulation.

TContext context

The context.

Methods

AddIfNo<TBehavior>(Func<TContext, IBehavior>)

Adds a behavior if the specified behavior does not yet exist in the container.

Declaration
public IBehaviorContainerBuilder<TContext> AddIfNo<TBehavior>(Func<TContext, IBehavior> factory) where TBehavior : IBehavior
Parameters
Type Name Description
Func<TContext, IBehavior> factory

The factory.

Returns
Type Description
IBehaviorContainerBuilder<TContext>

The original container builder. This can be used for chaining.

Type Parameters
Name Description
TBehavior

The target type of the behavior.

Exceptions
Type Condition
ArgumentNullException

Thrown if factory is null.

Implements

IBehaviorContainerBuilder<TContext>

Extension Methods

Utility.ThrowIfNull<T>(T, string)

See Also

IBehaviorContainerBuilder<TContext>
In this article
Back to top Generated by DocFX