ภาษา

RouteAttributeHelper Class

Definition

Shared helper for applying sign-in handlers to a route builder.

public static class RouteAttributeHelper
type RouteAttributeHelper = class
Public Class RouteAttributeHelper
Inheritance
RouteAttributeHelper

Methods

Name Description
ApplySignInHandlers(AgentApplication, String, Action<String>, Action<Func<ITurnContext,String[]>>)

Applies sign-in handlers to a route builder by invoking withDelegate if autoSignInHandlers names a method on app matching Func<ITurnContext, string[]>, otherwise invoking withDelimited to treat it as a comma/space/semicolon-delimited list of handler names.

CreateHandlerDelegate(AgentApplication, MethodInfo, Type)

Creates a bound delegate of the given delegateType from method, handling both instance and static methods. For instance methods the delegate is bound to app; for static methods no target is bound.

CreateHandlerDelegate<T>(AgentApplication, MethodInfo)

Creates a bound delegate from method, handling both instance and static methods. For instance methods the delegate is bound to app; for static methods no target is bound.

CreateMatchingHandlerDelegate(AgentApplication, MethodInfo, Type)

Selects the first handler delegate Type declared on attributeType via RouteHandlerTypeAttribute whose Invoke signature matches method, then creates a bound delegate of that type. This lets a single route attribute accept more than one handler signature (for example ActionExecuteHandler or ActionExecuteInvokeHandler), resolving the concrete delegate from the decorated method at registration time.

DelimitedToList(String)
GetDeclaredHandlerType(Type)

Returns the first handler delegate Type declared on a route attribute class via RouteHandlerTypeAttribute, or null when none is declared.

GetDeclaredHandlerTypes(Type)

Returns all handler delegate Type values declared on a route attribute class via one or more RouteHandlerTypeAttribute applications. A method decorated with the attribute is valid if it matches any of them. Returns an empty array when none are declared.

InvokeGenericWithHandler(AgentApplication, MethodInfo, Type, Int32, Object)

Infers the generic type parameter from the method's third parameter, creates a delegate of openHandlerType<T>, then finds and invokes the generic WithHandler<T> method on builder.

Applies to