forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphAuthenticationBotAccessors.cs
More file actions
61 lines (53 loc) · 2.52 KB
/
GraphAuthenticationBotAccessors.cs
File metadata and controls
61 lines (53 loc) · 2.52 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// 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 GraphAuthenticationBotAccessors
{
/// <summary>
/// Initializes a new instance of the <see cref="GraphAuthenticationBotAccessors"/> 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 GraphAuthenticationBotAccessors(ConversationState conversationState, UserState userState)
{
UserState = userState ?? throw new ArgumentNullException(nameof(userState));
ConversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState));
}
// The name of the dialog state.
public static readonly string DialogStateName = $"{nameof(GraphAuthenticationBotAccessors)}.DialogState";
// The name of the command state.
public static readonly string CommandStateName = $"{nameof(GraphAuthenticationBotAccessors)}.CommandState";
/// <summary>
/// Gets or Sets the DialogState accessor value.
/// </summary>
/// <value>
/// A <see cref="DialogState"/> representing the state of the conversation.
/// </value>
public IStatePropertyAccessor<DialogState> ConversationDialogState { get; set; }
/// <summary>
/// Gets or Sets the DialogState accessor value.
/// </summary>
/// <value>
/// A string representing the command a user would like to execute.
/// </value>
public IStatePropertyAccessor<string> CommandState { get; set; }
/// <summary>
/// Gets the <see cref="UserState"/> object for the conversation.
/// </summary>
/// <value>The <see cref="UserState"/> object.</value>
public UserState UserState { get; }
/// <summary>
/// Gets the <see cref="ConversationState"/> object for the conversation.
/// </summary>
/// <value>The <see cref="ConversationState"/> object.</value>
public ConversationState ConversationState { get; }
}
}