-
Notifications
You must be signed in to change notification settings - Fork 1
Analyze the code, build and run the bot
To build and run the service using latest version of Visual Studio
- Go to File > Open > Project/Solution.
- Select TeamsMessagingExtensionsAction.csproj file from /labs/NewBotACE/csharp/.
- Open SharePointAdapativeCardExtensionBot.cs under /Bots folder. In the SharePointAdapativeCardExtensionBot class you'll find these following methods:
protected override Task<GetQuickViewResponse> OnSharePointTaskGetQuickViewAsync(ITurnContext<IInvokeActivity> turnContext, TaskModuleRequest taskModuleRequest, CancellationToken cancellationToken)
...
protected override Task<GetCardViewResponse> OnSharePointTaskGetCardViewAsync(ITurnContext<IInvokeActivity> turnContext, TaskModuleRequest taskModuleRequest, CancellationToken cancellationToken)
...
protected override Task<GetPropertyPaneConfigurationResponse> OnSharePointTaskGetPropertyPaneConfigurationAsync(ITurnContext<IInvokeActivity> turnContext, TaskModuleRequest taskModuleRequest, CancellationToken cancellationToken)
...
protected override Task OnSharePointTaskSetPropertyPaneConfigurationAsync(ITurnContext<IInvokeActivity> turnContext, TaskModuleRequest taskModuleRequest, CancellationToken cancellationToken)
Let's quickly review what those methods are and how they get used by ACEs infrastructure:
OnSharePointTaskGetCardViewAsync
This method gets called when a card view is rendered. As a card may have multiple views, each view rendering calls this method. The code in the sample generates this output:
OnSharePointTaskGetQuickViewAsync
This method gets called when a quick view is rendered. As a card may have multiple quick views, each view rendering will call this method. The code in the sample generates this output:
OnSharePointTaskGetPropertyPaneConfigurationAsync
This method gets called when the dahsboard operator configures the card and opens the property pane. Developers can use this method to surface configuration options for the operator to configure a specific instance of the card.
OnSharePointTaskSetPropertyPaneConfigurationAsync
This method gets called when the dashboard operator commits the changes in the property pane.
You can find out more about this data, how it's rendered and the different card view templates at https://aka.ms/spfx or more specifically Build your first SharePoint Adaptive Card Extension | Microsoft Learn.
To run the project:
- Press F5 to run the project.
- Select Yes if the following dialog appears:
A webpage appears with a message Your bot is ready!.