/// <summary> /// Initializes a new instance of the <see cref="ShowToDoTasksDialog"/> class. /// </summary> /// <param name="toDoSkillServices">The To Do skill service.</param> /// <param name="toDoService">The To Do service.</param> /// <param name="accessors">The state accessors.</param> public ShowToDoTasksDialog(ToDoSkillServices toDoSkillServices, IToDoService toDoService, ToDoSkillAccessors accessors) : base(Name, toDoSkillServices, accessors, toDoService) { var showToDoTasks = new WaterfallStep[] { this.GetAuthToken, this.AfterGetAuthToken, this.ClearContext, this.ShowToDoTasks, this.AddFirstTask, }; var addFirstTask = new WaterfallStep[] { this.AskAddFirstTaskConfirmation, this.AfterAskAddFirstTaskConfirmation, }; // Define the conversation flow using a waterfall model. this.AddDialog(new WaterfallDialog(Action.ShowToDoTasks, showToDoTasks)); this.AddDialog(new WaterfallDialog(Action.AddFirstTask, addFirstTask)); this.AddDialog(new AddToDoTaskDialog(toDoSkillServices, toDoService, accessors)); // Set starting dialog for component this.InitialDialogId = Action.ShowToDoTasks; }
/// <summary> /// Initializes a new instance of the <see cref="MarkToDoTaskDialog"/> class. /// </summary> /// <param name="toDoSkillServices">The To Do skill service.</param> /// <param name="toDoService">The To Do service.</param> /// <param name="accessors">The state accessors.</param> public MarkToDoTaskDialog(ToDoSkillServices toDoSkillServices, IToDoService toDoService, ToDoSkillAccessors accessors) : base(Name, toDoSkillServices, accessors, toDoService) { var markToDoTask = new WaterfallStep[] { this.GetAuthToken, this.AfterGetAuthToken, this.ClearContext, this.CollectToDoTaskIndex, this.MarkToDoTaskCompleted, }; var collectToDoTaskIndex = new WaterfallStep[] { this.AskToDoTaskIndex, this.AfterAskToDoTaskIndex, }; // Define the conversation flow using a waterfall model. this.AddDialog(new WaterfallDialog(Action.MarkToDoTaskCompleted, markToDoTask)); this.AddDialog(new WaterfallDialog(Action.CollectToDoTaskIndex, collectToDoTaskIndex)); // Set starting dialog for component this.InitialDialogId = Action.MarkToDoTaskCompleted; }
/// <summary> /// Initializes a new instance of the <see cref="GreetingDialog"/> class. /// </summary> /// <param name="toDoSkillServices">The To Do skill service.</param> /// <param name="toDoService">The To Do service.</param> /// <param name="accessors">The state accessors.</param> public GreetingDialog(ToDoSkillServices toDoSkillServices, IToDoService toDoService, ToDoSkillAccessors accessors) : base(Name, toDoSkillServices, accessors, toDoService) { // Define the conversation flow using a waterfall model. this.AddDialog(new WaterfallDialog(Action.Greeting, new WaterfallStep[] { this.GreetingStep })); // Set starting dialog for component this.InitialDialogId = Action.Greeting; }
/// <summary> /// Initializes a new instance of the <see cref="RootDialog"/> class. /// </summary> /// <param name="skillMode">Skill mode.</param> /// <param name="toDoSkillServices">To Do skill service.</param> /// <param name="toDoSkillAccessors">To Do skill accessors.</param> /// <param name="toDoService">To Do provider service.</param> public RootDialog(bool skillMode, ToDoSkillServices toDoSkillServices, ToDoSkillAccessors toDoSkillAccessors, IToDoService toDoService) : base(nameof(RootDialog)) { this.skillMode = skillMode; this.toDoSkillAccessors = toDoSkillAccessors; this.toDoService = toDoService; this.toDoSkillResponses = new ToDoSkillResponses(); this.toDoSkillServices = toDoSkillServices; // Initialise dialogs this.RegisterDialogs(); }
/// <summary> /// Initializes a new instance of the <see cref="ToDoSkillDialog"/> class. /// </summary> /// <param name="dialogId">Dialog id.</param> /// <param name="toDoSkillServices">To Do skill services.</param> /// <param name="accessors">To Do state accessors.</param> /// <param name="toDoService">To Do service.</param> public ToDoSkillDialog(string dialogId, ToDoSkillServices toDoSkillServices, ToDoSkillAccessors accessors, IToDoService toDoService) : base(dialogId) { this.toDoSkillServices = toDoSkillServices; this.accessors = accessors; this.toDoService = toDoService; var oauthSettings = new OAuthPromptSettings() { ConnectionName = this.toDoSkillServices.AuthConnectionName, Text = $"Authentication", Title = "Signin", Timeout = 300000, }; this.AddDialog(new EventPrompt(AuthSkillMode, "tokens/response", this.TokenResponseValidator)); this.AddDialog(new OAuthPrompt(AuthLocalMode, oauthSettings, this.AuthPromptValidator)); this.AddDialog(new TextPrompt(Action.Prompt)); }