InsertBehavior(TStunt, Int32, ExecuteHandler, AppliesToHandler?, String?) Method

Definition

Namespace Stunts
Assembly Stunts.dll

Inserts a behavior into the stunt behavior pipeline at the specified index.

public static TStunt InsertBehavior<TStunt>(this TStunt stunt, int index, ExecuteHandler behavior, AppliesToHandler? appliesTo = null, string? name = null)
    where TStunt : IStunt

Type parameters

TStunt

Parameters

stunt
{TStunt}

The stunt to insert the behavior to.

index
Int32

The index to insert the behavior at.

behavior
ExecuteHandler

(invocation, next) => invocation.CreateValueReturn() | invocation.CreateExceptionReturn() | next().Invoke(invocation, next)

appliesTo
AppliesToHandler

invocation => true|false

name
String

Optional friendly name for the behavior.

Returns

{TStunt}