Table of Contents

Class AdaptiveCardsFeature

Namespace
Microsoft.Agents.Builder.App.AdaptiveCards
Assembly
Microsoft.Agents.Builder.dll

AdaptiveCards class to enable fluent style registration of handlers related to Adaptive Cards.

public class AdaptiveCardsFeature
Inheritance
AdaptiveCardsFeature
Inherited Members

Constructors

AdaptiveCardsFeature(AgentApplication)

Creates a new instance of the AdaptiveCards class.

public AdaptiveCardsFeature(AgentApplication app)

Parameters

app AgentApplication

Methods

OnActionExecute(MultipleRouteSelector, ActionExecuteHandler)

Adds a route to the application for handling Adaptive Card Action.Execute events.

public AgentApplication OnActionExecute(MultipleRouteSelector routeSelectors, ActionExecuteHandler handler)

Parameters

routeSelectors MultipleRouteSelector

Combination of String, Regex, and RouteSelectorAsync selectors.

handler ActionExecuteHandler

Function to call when the route is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

OnActionExecute(RouteSelector, ActionExecuteHandler)

Adds a route to the application for handling Adaptive Card Action.Execute events.

public AgentApplication OnActionExecute(RouteSelector routeSelector, ActionExecuteHandler handler)

Parameters

routeSelector RouteSelector

Function that's used to select a route. The function returning true triggers the route.

handler ActionExecuteHandler

Function to call when the route is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

OnActionExecute(string, ActionExecuteHandler)

Adds a route to the application for handling Adaptive Card Action.Execute events.

public AgentApplication OnActionExecute(string verb, ActionExecuteHandler handler)

Parameters

verb string

The named action to be handled.

handler ActionExecuteHandler

Function to call when the action is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

OnActionExecute(Regex, ActionExecuteHandler)

Adds a route to the application for handling Adaptive Card Action.Execute events.

public AgentApplication OnActionExecute(Regex verbPattern, ActionExecuteHandler handler)

Parameters

verbPattern Regex

Regular expression to match against the named action to be handled.

handler ActionExecuteHandler

Function to call when the action is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

OnActionSubmit(MultipleRouteSelector, ActionSubmitHandler)

Adds a route to the application for handling Adaptive Card Action.Submit events.

public AgentApplication OnActionSubmit(MultipleRouteSelector routeSelectors, ActionSubmitHandler handler)

Parameters

routeSelectors MultipleRouteSelector

Combination of String, Regex, and RouteSelectorAsync selectors.

handler ActionSubmitHandler

Function to call when the route is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

Remarks

The route will be added for the specified verb(s) and will be filtered using the actionSubmitFilter option. The default filter is to use the verb field.

For outgoing AdaptiveCards you will need to include the verb's name in the cards Action.Submit. For example:

{
  "type": "Action.Submit",
  "title": "OK",
  "data": {
    "verb": "ok"
  }
}

OnActionSubmit(RouteSelector, ActionSubmitHandler)

Adds a route to the application for handling Adaptive Card Action.Submit events.

public AgentApplication OnActionSubmit(RouteSelector routeSelector, ActionSubmitHandler handler)

Parameters

routeSelector RouteSelector

Function that's used to select a route. The function returning true triggers the route.

handler ActionSubmitHandler

Function to call when the route is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

Remarks

The route will be added for the specified verb(s) and will be filtered using the actionSubmitFilter option. The default filter is to use the verb field.

For outgoing AdaptiveCards you will need to include the verb's name in the cards Action.Submit. For example:

{
  "type": "Action.Submit",
  "title": "OK",
  "data": {
    "verb": "ok"
  }
}

OnActionSubmit(string, ActionSubmitHandler)

Adds a route to the application for handling Adaptive Card Action.Submit events.

public AgentApplication OnActionSubmit(string verb, ActionSubmitHandler handler)

Parameters

verb string

The named action to be handled.

handler ActionSubmitHandler

Function to call when the action is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

Remarks

The route will be added for the specified verb(s) and will be filtered using the actionSubmitFilter option. The default filter is to use the verb field.

For outgoing AdaptiveCards you will need to include the verb's name in the cards Action.Submit. For example:

{
  "type": "Action.Submit",
  "title": "OK",
  "data": {
    "verb": "ok"
  }
}

OnActionSubmit(Regex, ActionSubmitHandler)

Adds a route to the application for handling Adaptive Card Action.Submit events.

public AgentApplication OnActionSubmit(Regex verbPattern, ActionSubmitHandler handler)

Parameters

verbPattern Regex

Regular expression to match against the named action to be handled.

handler ActionSubmitHandler

Function to call when the route is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

Remarks

The route will be added for the specified verb(s) and will be filtered using the actionSubmitFilter option. The default filter is to use the verb field.

For outgoing AdaptiveCards you will need to include the verb's name in the cards Action.Submit. For example:

{
  "type": "Action.Submit",
  "title": "OK",
  "data": {
    "verb": "ok"
  }
}

OnSearch(MultipleRouteSelector, SearchHandler)

Adds a route to the application for handling Adaptive Card dynamic search events.

public AgentApplication OnSearch(MultipleRouteSelector routeSelectors, SearchHandler handler)

Parameters

routeSelectors MultipleRouteSelector

Combination of String, Regex, and RouteSelectorAsync selectors.

handler SearchHandler

Function to call when the route is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

OnSearch(RouteSelector, SearchHandler)

Adds a route to the application for handling Adaptive Card dynamic search events.

public AgentApplication OnSearch(RouteSelector routeSelector, SearchHandler handler)

Parameters

routeSelector RouteSelector

Function that's used to select a route. The function returning true triggers the route.

handler SearchHandler

Function to call when the route is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

OnSearch(string, SearchHandler)

Adds a route to the application for handling Adaptive Card dynamic search events.

public AgentApplication OnSearch(string dataset, SearchHandler handler)

Parameters

dataset string

The dataset to be searched.

handler SearchHandler

Function to call when the search is triggered.

Returns

AgentApplication

The application instance for chaining purposes.

OnSearch(Regex, SearchHandler)

Adds a route to the application for handling Adaptive Card dynamic search events.

public AgentApplication OnSearch(Regex datasetPattern, SearchHandler handler)

Parameters

datasetPattern Regex

Regular expression to match against the dataset to be searched.

handler SearchHandler

Function to call when the search is triggered.

Returns

AgentApplication

The application instance for chaining purposes.