garypretty / botframework

Microsoft Bot Framework helpers and additional dialogs
MIT License
60 stars 51 forks source link

Retrieve bestMatchListDelimited from resource file #8

Closed rikharink closed 4 years ago

rikharink commented 7 years ago

This gives the attribute another option to retrieve the bestMatchListDelimited string from a resource file while still being able to use the attribute notation. I've also changed the sample to reflect this new possibility.

The following code taken from the sample illustrates the way this new option works:

[BestMatch(typeof(BestMatchDialogResources), nameof(BestMatchDialogResources.CommonResponsesDialog_StatusRequest))]
public async Task HandleStatusRequest(IDialogContext context, string messageText)
{
        await context.PostAsync("I am great.");
        context.Wait(MessageReceived);
}