Skip to content

Instantly share code, notes, and snippets.

View beachside-project's full-sized avatar
😄

Atsushi YOKOHAMA beachside-project

😄
View GitHub Profile
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]
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
{
@beachside-project
beachside-project / SandwichOrderV3.cs
Created July 11, 2016 06:19
FormFlowV3.Dialogs.SandwichOrder
using System;
using System.Collections.Generic;
using Microsoft.Bot.Builder.FormFlow;
namespace FormFlowV3.Dialogs
{
[Serializable]
public class SandwichOrder
{
public SandwichOptions? Sandwich;
@beachside-project
beachside-project / MessagesController1.cs
Created July 11, 2016 09:42
FormFlowV3.Controllers
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>
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))
@beachside-project
beachside-project / SandwichOrder.cs
Last active February 22, 2017 11:53
FormFlow-Using the Form Builder
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]
@beachside-project
beachside-project / MessagesController_simpleEcho.cs
Created July 15, 2016 11:32
MessagesController_simpleEcho
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
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);
using System;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
namespace DialogDemo.Dialogs
{
[Serializable]
public class StateEchoDialog : IDialog<object>
{
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