forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBotAccessors.cs
39 lines (35 loc) · 1.63 KB
/
BotAccessors.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
38
39
// 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="PromptValidationsBot"/> 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 BotAccessors
{
/// <summary>
/// Initializes a new instance of the <see cref="BotAccessors"/> class.
/// Contains the <see cref="ConversationState"/> and associated <see cref="IStatePropertyAccessor{T}"/>.
/// </summary>
/// <param name="conversationState">The state object that stores the counter.</param>
public BotAccessors(ConversationState conversationState)
{
this.ConversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState));
}
/// <summary>
/// Gets or sets conversation state which is of type DialogState. Under the covers this is a serialized dialog stack.
/// </summary>
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; }
}
}