forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CardsBotAccessors.cs
47 lines (42 loc) · 1.9 KB
/
CardsBotAccessors.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
40
41
42
43
44
45
46
47
// 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 is a helper class to support the state accessors for the bot.
/// </summary>
public class CardsBotAccessors
{
/// <summary>
/// The name of the dialog state.
/// </summary>
/// <remarks>Accessors require a unique name.</remarks>
/// <value>The accessor name for the dialog state accessor.</value>
public static readonly string DialogStateName = $"{nameof(CardsBotAccessors)}.DialogState";
/// <summary>
/// Initializes a new instance of the <see cref="CardsBotAccessors"/> 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>
/// <param name="userState">The state object that stores the user state.</param>
public CardsBotAccessors(ConversationState conversationState)
{
ConversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState));
}
/// <summary>
/// Gets or sets the <see cref="IStatePropertyAccessor{T}"/> for ConversationDialogState.
/// </summary>
/// <value>
/// The accessor stores the dialog state for the conversation.
/// </value>
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; }
}
}