public async Task AfterConfirm_GetActiveWorkbook(IDialogContext context, IAwaitable <bool> result)
 {
     if (await result)
     {
         await WorkbookWorker.DoGetActiveWorkbookAsync(context);
     }
     context.Wait(MessageReceived);
 }
        public async Task GetActiveWorkbook(IDialogContext context, LuisResult result)
        {
            // Telemetry
            TelemetryHelper.TrackDialog(context, result, "Workbooks", "GetActiveWorkbook");

            string workbookId = String.Empty;

            context.UserData.TryGetValue <string>("WorkbookId", out workbookId);

            if ((workbookId != null) && (workbookId != String.Empty))
            {
                await WorkbookWorker.DoGetActiveWorkbookAsync(context);

                context.Wait(MessageReceived);
            }
            else
            {
                context.Call <bool>(new ConfirmOpenWorkbookDialog(), AfterConfirm_GetActiveWorkbook);
            }
        }