forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimplePromptBotAccessors.cs
37 lines (33 loc) · 1.59 KB
/
SimplePromptBotAccessors.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs;
namespace Microsoft.BotBuilderSamples
{
/// <summary>
/// This class is created as a Singleton and passed into the IBot-derived constructor.
/// - See <see cref="SimplePromptBot"/> constructor for how that is injected.
/// - See the Startup.cs file for more details on creating the Singleton that gets
/// injected into the constructor.
/// </summary>
public class SimplePromptBotAccessors
{
/// <summary>
/// Initializes a new instance of the <see cref="SimplePromptBotAccessors"/> class.
/// Contains the <see cref="ConversationState"/> and associated <see cref="IStatePropertyAccessor{T}"/>.
/// </summary>
/// <param name="conversationState">The state object that stores the dialog state.</param>
public SimplePromptBotAccessors(ConversationState conversationState)
{
ConversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState));
}
// Conversation state is of type DialogState. Under the covers this is a serialized dialog stack.
public IStatePropertyAccessor<DialogState> ConversationDialogState { get; set; }
/// <summary>
/// Gets the <see cref="ConversationState"/> object for the conversation.
/// </summary>
/// <value>The <see cref="ConversationState"/> object.</value>
public ConversationState ConversationState { get; }
}
}