AgentApplication.OnEvent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| OnEvent(String, RouteHandler, UInt16, String[]) |
Handles incoming Event with a specific Name. |
| OnEvent(Regex, RouteHandler, UInt16, String[]) |
Handles incoming Events matching a Name pattern. |
| OnEvent(RouteSelector, RouteHandler, UInt16, String[]) |
Handles incoming Events. |
OnEvent(String, RouteHandler, UInt16, String[])
Handles incoming Event with a specific Name.
public Microsoft.Agents.Builder.App.AgentApplication OnEvent(string eventName, Microsoft.Agents.Builder.App.RouteHandler handler, ushort rank = 32767, string[] autoSignInHandlers = default);
member this.OnEvent : string * Microsoft.Agents.Builder.App.RouteHandler * uint16 * string[] -> Microsoft.Agents.Builder.App.AgentApplication
Public Function OnEvent (eventName As String, handler As RouteHandler, Optional rank As UShort = 32767, Optional autoSignInHandlers As String() = Nothing) As AgentApplication
Parameters
- eventName
- String
Substring of the incoming message text.
- handler
- RouteHandler
Function to call when the route is triggered.
- rank
- UInt16
0 - ushort.MaxValue for order of evaluation. Ranks of the same value are evaluated in order of addition.
- autoSignInHandlers
- String[]
Returns
The application instance for chaining purposes.
Applies to
OnEvent(Regex, RouteHandler, UInt16, String[])
Handles incoming Events matching a Name pattern.
public Microsoft.Agents.Builder.App.AgentApplication OnEvent(System.Text.RegularExpressions.Regex namePattern, Microsoft.Agents.Builder.App.RouteHandler handler, ushort rank = 32767, string[] autoSignInHandlers = default);
member this.OnEvent : System.Text.RegularExpressions.Regex * Microsoft.Agents.Builder.App.RouteHandler * uint16 * string[] -> Microsoft.Agents.Builder.App.AgentApplication
Public Function OnEvent (namePattern As Regex, handler As RouteHandler, Optional rank As UShort = 32767, Optional autoSignInHandlers As String() = Nothing) As AgentApplication
Parameters
- namePattern
- Regex
Regular expression to match against the text of an incoming message.
- handler
- RouteHandler
Function to call when the route is triggered.
- rank
- UInt16
0 - ushort.MaxValue for order of evaluation. Ranks of the same value are evaluated in order of addition.
- autoSignInHandlers
- String[]
Returns
The application instance for chaining purposes.
Applies to
OnEvent(RouteSelector, RouteHandler, UInt16, String[])
Handles incoming Events.
public Microsoft.Agents.Builder.App.AgentApplication OnEvent(Microsoft.Agents.Builder.App.RouteSelector routeSelector, Microsoft.Agents.Builder.App.RouteHandler handler, ushort rank = 32767, string[] autoSignInHandlers = default);
member this.OnEvent : Microsoft.Agents.Builder.App.RouteSelector * Microsoft.Agents.Builder.App.RouteHandler * uint16 * string[] -> Microsoft.Agents.Builder.App.AgentApplication
Public Function OnEvent (routeSelector As RouteSelector, handler As RouteHandler, Optional rank As UShort = 32767, Optional autoSignInHandlers As String() = Nothing) As AgentApplication
Parameters
- routeSelector
- RouteSelector
Function that's used to select a route. The function returning true triggers the route.
- handler
- RouteHandler
Function to call when the route is triggered.
- rank
- UInt16
0 - ushort.MaxValue for order of evaluation. Ranks of the same value are evaluated in order of addition.
- autoSignInHandlers
- String[]
Returns
The application instance for chaining purposes.