-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Steps Folder => Actions Folder Switch to OnXXX naming pattern for events
- Loading branch information
Tom Laird-McConnell
committed
Jul 17, 2019
1 parent
c21e7c6
commit 0879e8b
Showing
170 changed files
with
2,328 additions
and
2,204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Events/OnActivity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Licensed under the MIT License. | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using Microsoft.Bot.Builder.Expressions; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Events | ||
{ | ||
|
||
/// <summary> | ||
/// Event triggered when a Activity of a given type is received | ||
/// </summary> | ||
public class OnActivity : OnDialogEvent | ||
{ | ||
[JsonConstructor] | ||
public OnActivity(string type=null, List<IDialog> actions = null, string constraint = null, [CallerFilePath] string callerPath = "", [CallerLineNumber] int callerLine = 0) | ||
: base(events: new List<string>() | ||
{ | ||
AdaptiveEvents.ActivityReceived | ||
}, | ||
actions: actions, | ||
constraint: constraint, | ||
callerPath: callerPath, callerLine: callerLine) | ||
{ | ||
Type = type; | ||
} | ||
|
||
/// <summary> | ||
/// ActivityType | ||
/// </summary> | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
protected override Expression BuildExpression(IExpressionParser factory) | ||
{ | ||
|
||
// add constraints for activity type | ||
return Expression.AndExpression(factory.Parse($"turn.dialogEvent.value.type == '{this.Type}'"), | ||
base.BuildExpression(factory)); | ||
} | ||
|
||
protected override ActionChangeList OnCreateChangeList(SequenceContext planning, object dialogOptions = null) | ||
{ | ||
return new ActionChangeList() | ||
{ | ||
Actions = Actions.Select(s => new ActionState() | ||
{ | ||
DialogStack = new List<DialogInstance>(), | ||
DialogId = s.Id, | ||
Options = dialogOptions | ||
}).ToList() | ||
}; | ||
} | ||
|
||
public override string GetIdentity() | ||
{ | ||
return $"{this.GetType().Name}({this.Type})[{this.Constraint}]"; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Events/OnConversationUpdateActivity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed under the MIT License. | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
|
||
using System.Collections.Generic; | ||
using System.Runtime.CompilerServices; | ||
using Microsoft.Bot.Schema; | ||
using Newtonsoft.Json; | ||
|
||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Events | ||
{ | ||
/// <summary> | ||
/// Event for ConversationUpdate Activity | ||
/// </summary> | ||
public class OnConversationUpdateActivity : OnActivity | ||
{ | ||
[JsonConstructor] | ||
public OnConversationUpdateActivity(List<IDialog> actions = null, string constraint= null, [CallerFilePath] string callerPath = "", [CallerLineNumber] int callerLine = 0) | ||
: base(type: ActivityTypes.ConversationUpdate, actions: actions, constraint: constraint, callerPath: callerPath, callerLine: callerLine) { } | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Events/OnEndOfConversationActivity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed under the MIT License. | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
|
||
using System.Collections.Generic; | ||
using System.Runtime.CompilerServices; | ||
using Microsoft.Bot.Schema; | ||
using Newtonsoft.Json; | ||
|
||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Events | ||
{ | ||
/// <summary> | ||
/// Event for EndOfConversation Activity | ||
/// </summary> | ||
public class OnEndOfConversationActivity : OnActivity | ||
{ | ||
[JsonConstructor] | ||
public OnEndOfConversationActivity(List<IDialog> actions = null, string constraint= null, [CallerFilePath] string callerPath = "", [CallerLineNumber] int callerLine = 0) | ||
: base(type: ActivityTypes.EndOfConversation, actions: actions, constraint: constraint, callerPath: callerPath, callerLine: callerLine) { } | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Events/OnEventActivity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed under the MIT License. | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
|
||
using System.Collections.Generic; | ||
using System.Runtime.CompilerServices; | ||
using Microsoft.Bot.Schema; | ||
using Newtonsoft.Json; | ||
|
||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Events | ||
{ | ||
/// <summary> | ||
/// Event for Event Activity | ||
/// </summary> | ||
public class OnEventActivity : OnActivity | ||
{ | ||
[JsonConstructor] | ||
public OnEventActivity(List<IDialog> actions = null, string constraint= null, [CallerFilePath] string callerPath = "", [CallerLineNumber] int callerLine = 0) | ||
: base(type: ActivityTypes.Event, actions: actions, constraint: constraint, callerPath: callerPath, callerLine: callerLine) { } | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Events/OnHandoffActivity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed under the MIT License. | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
|
||
using System.Collections.Generic; | ||
using System.Runtime.CompilerServices; | ||
using Microsoft.Bot.Schema; | ||
using Newtonsoft.Json; | ||
|
||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Events | ||
{ | ||
/// <summary> | ||
/// Event for Handoff Activity | ||
/// </summary> | ||
public class OnHandoffActivity : OnActivity | ||
{ | ||
[JsonConstructor] | ||
public OnHandoffActivity(List<IDialog> actions = null, string constraint= null, [CallerFilePath] string callerPath = "", [CallerLineNumber] int callerLine = 0) | ||
: base(type: ActivityTypes.Handoff, actions: actions, constraint: constraint, callerPath: callerPath, callerLine: callerLine) { } | ||
} | ||
|
||
} |
Oops, something went wrong.