Example #1
0
        public RootDialog(UserState userState) : base("root")
        {
            _userState = userState;

            AddDialog(new UserProfileDialog(userState));

            // The initial child Dialog to run.
            InitialDialogId = "waterfall";

            // Get Folder of dialogs.
            var resourceExplorer = new ResourceExplorer().AddFolder("Dialogs");

            // find the main composer dialog to start with
            var composerDialog = resourceExplorer.GetResource("Main.dialog");

            // hyrdate an Adaptive Dialogue
            AdaptiveDialog myComposerDialog = DeclarativeTypeLoader.Load <AdaptiveDialog>(composerDialog, resourceExplorer, DebugSupport.SourceMap);

            myComposerDialog.Id = "Main.dialog";

            // setup lanaguage generation for the dialogue
            myComposerDialog.Generator = new TemplateEngineLanguageGenerator(new TemplateEngine().AddFile(@"C:\Users\Jamie\source\repos\composer-adaptive-regular-hybrid\Dialogs\ComposerDialogs\Main\Main.lg"));

            // add to the ComponentDialog which Root dialogue inherits from
            AddDialog(myComposerDialog);

            AddDialog(new WaterfallDialog("waterfall", new WaterfallStep[] { StartDialogAsync, BeginComposerAdaptiveDialog }));
        }
Example #2
0
 public BotStatePropertyAccessor(BotState botState, string name)
 {
     _botState = botState;
     Name      = name;
 }
Example #3
0
 /// <summary>
 /// Add a BotState to the list of sources to load.
 /// </summary>
 /// <param name="botState">botState to manage.</param>
 /// <returns>botstateset for chaining more .Use().</returns>
 public BotStateSet Use(BotState botState)
 {
     BotStates.Add(botState);
     return(this);
 }