forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BotAccessors.cs
34 lines (30 loc) · 1.31 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
// 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>
/// The accessors used in the bot logic. This class allows them to be easily
/// handed to the IBot instance through the dependency injection.
/// </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 dialog state.</param>
public BotAccessors(ConversationState conversationState)
{
ConversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState));
}
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; }
}
}