All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.bot.builder.dialogs.DialogContainer Maven / Gradle / Ivy

/*
public class DialogContainer implements IDialogContinue


{
    protected DialogSet Dialogs { get; set; }
    protected string DialogId { get; set; }

    public DialogContainer(string dialogId, DialogSet dialogs = null)
    {
        if (string.IsNullOrEmpty(dialogId))
            throw new ArgumentNullException(nameof(dialogId));

        Dialogs dialogs = (dialogs != null) ? dialogs : new DialogSet();
        DialogId = dialogId;
    }

    public async Task DialogBegin(DialogContext dc, IDictionary dialogArgs = null)
    {
        if (dc == null)
            throw new ArgumentNullException(nameof(dc));

        // Start the controls entry point dialog. 
        IDictionary result = null;
        var cdc = new DialogContext(this.Dialogs, dc.Context, dc.ActiveDialog.State, (r) => { result = r; });
        await cdc.Begin(DialogId, dialogArgs);
        // End if the controls dialog ends.
        if (cdc.ActiveDialog == null)
        {
            await dc.End(result);
        }
    }

    public async Task DialogContinue(DialogContext dc)
    {
        if (dc == null)
            throw new ArgumentNullException(nameof(dc));

        // Continue controls dialog stack.
        IDictionary result = null;
        var cdc = new DialogContext(this.Dialogs, dc.Context, dc.ActiveDialog.State, (r) => { result = r; });
        await cdc.Continue();
        // End if the controls dialog ends.
        if (cdc.ActiveDialog == null)
        {
            await dc.End(result);
        }
    }
}
*/




© 2015 - 2025 Weber Informatics LLC | Privacy Policy