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
MultipleRouteSelectorCombination of String, Regex, and RouteSelectorAsync selectors.
handler
ActionExecuteHandlerFunction 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
RouteSelectorFunction that's used to select a route. The function returning true triggers the route.
handler
ActionExecuteHandlerFunction 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
stringThe named action to be handled.
handler
ActionExecuteHandlerFunction 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
RegexRegular expression to match against the named action to be handled.
handler
ActionExecuteHandlerFunction 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
MultipleRouteSelectorCombination of String, Regex, and RouteSelectorAsync selectors.
handler
ActionSubmitHandlerFunction 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
RouteSelectorFunction that's used to select a route. The function returning true triggers the route.
handler
ActionSubmitHandlerFunction 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
stringThe named action to be handled.
handler
ActionSubmitHandlerFunction 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
RegexRegular expression to match against the named action to be handled.
handler
ActionSubmitHandlerFunction 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
MultipleRouteSelectorCombination of String, Regex, and RouteSelectorAsync selectors.
handler
SearchHandlerFunction 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
RouteSelectorFunction that's used to select a route. The function returning true triggers the route.
handler
SearchHandlerFunction 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
stringThe dataset to be searched.
handler
SearchHandlerFunction 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
RegexRegular expression to match against the dataset to be searched.
handler
SearchHandlerFunction to call when the search is triggered.
Returns
- AgentApplication
The application instance for chaining purposes.