Skip to content

ICompositeListenerBuilder<TContext, TBaseNode>.With Method ​

Overloads ​

NameDescription
With(Listener<TContext, TBaseNode>)Add a listener for the base node type. Useful to provide a fallback listener when there is no listener for the specific node type registered.
With<TNode>(NodeListener<TContext, TBaseNode, TNode>)Add a listener for the specific node type TNode. This can be a base node type which will be used if there is no listener for the specific node type registered.

With(Listener<TContext, TBaseNode>) ​

Add a listener for the base node type. Useful to provide a fallback listener when there is no listener for the specific node type registered.

c#
public abstract ICompositeListenerBuilder<TContext, TBaseNode> With(Listener<TContext, TBaseNode> listener);

Parameters ​

NameTypeDescription
listenerListener<TContext, TBaseNode>The listener.

Returns ​

ICompositeListenerBuilder<TContext, TBaseNode>

The fluent builder.

With<TNode>(NodeListener<TContext, TBaseNode, TNode>) ​

Add a listener for the specific node type TNode. This can be a base node type which will be used if there is no listener for the specific node type registered.

c#
public abstract ICompositeListenerBuilder<TContext, TBaseNode> With<TNode>(NodeListener<TContext, TBaseNode, TNode> listener)
   where TNode : TBaseNode;

Type Parameters ​

NameDescription
TNodeThe type of the node listener listens to.

Parameters ​

NameTypeDescription
listenerNodeListener<TContext, TBaseNode, TNode>The listener.

Returns ​

ICompositeListenerBuilder<TContext, TBaseNode>

The fluent builder.