This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading.Tasks; | |
using System.Web.Http; | |
using FormFlow1.Dialogs; | |
using Microsoft.Bot.Builder.Dialogs; | |
using Microsoft.Bot.Builder.FormFlow; | |
using Microsoft.Bot.Connector; | |
namespace FormFlow1.Controllers | |
{ | |
[BotAuthentication] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.Bot.Builder.Dialogs; | |
using Microsoft.Bot.Builder.FormFlow; | |
using Microsoft.Bot.Builder.FormFlow.Advanced; | |
namespace FormFlow1.Dialogs | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Microsoft.Bot.Builder.FormFlow; | |
namespace FormFlowV3.Dialogs | |
{ | |
[Serializable] | |
public class SandwichOrder | |
{ | |
public SandwichOptions? Sandwich; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace FormFlowV3.Controllers | |
{ | |
[BotAuthentication] | |
public class MessagesController : ApiController | |
{ | |
/// <summary> | |
/// POST: api/Messages | |
/// receive a message from a user and send replies | |
/// </summary> | |
/// <param name="activity"></param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IForm<SandwichOrder> BuildForm() | |
{ | |
return new FormBuilder<SandwichOrder>() | |
.Message("サンドイッチボットへようこそ♪") | |
.Field(nameof(Toppings), | |
validate: async (state, value) => | |
{ | |
var values = ((List<object>)value).OfType<ToppingOptions>(); | |
var result = new ValidateResult() { IsValid = true, Value = values }; | |
if (values != null && values.Contains(ToppingOptions.Everything)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.Bot.Builder.Dialogs; | |
using Microsoft.Bot.Builder.FormFlow; | |
using Microsoft.Bot.Builder.FormFlow.Advanced; | |
namespace FormFlowV3.Dialogs | |
{ | |
[Serializable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using System.Web.Http; | |
using System.Web.Http.Description; | |
using DialogDemo.Dialogs; | |
using Microsoft.Bot.Builder.Dialogs; | |
using Microsoft.Bot.Connector; | |
namespace DialogDemo.Controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Bot.Builder.Dialogs.Internals; | |
namespace DialogDemo.Dialogs | |
{ | |
internal class DialogSampleUtil | |
{ | |
internal static int IncrementCount<T>(T context) where T : IBotData | |
{ | |
int count; | |
context.UserData.TryGetValue(UserDataKey.Count, out count); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using Microsoft.Bot.Builder.Dialogs; | |
using Microsoft.Bot.Connector; | |
namespace DialogDemo.Dialogs | |
{ | |
[Serializable] | |
public class StateEchoDialog : IDialog<object> | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using Microsoft.Bot.Builder.Dialogs; | |
using System.Text.RegularExpressions; | |
namespace DialogDemo.Dialogs | |
{ | |
public class EchoCommandDialog |