public async Task GetNamedItemValue(IDialogContext context, LuisResult result) { // Telemetry TelemetryHelper.TrackDialog(context, result, "NamedItems", "GetNamedItemValue"); var name = LuisHelper.GetNameEntity(result.Entities); if (!(String.IsNullOrEmpty(name))) { context.UserData.SetValue <string>("Name", name); context.UserData.SetValue <ObjectType>("Type", ObjectType.NamedItem); string workbookId = String.Empty; context.UserData.TryGetValue <string>("WorkbookId", out workbookId); if (!(String.IsNullOrEmpty(workbookId))) { await NamedItemsWorker.DoGetNamedItemValue(context); context.Wait(MessageReceived); } else { context.Call <bool>(new ConfirmOpenWorkbookDialog(), AfterConfirm_GetNamedItemValue); } } else { await context.PostAsync($"You need to provide a name to get the value"); context.Wait(MessageReceived); } }
public async Task AfterConfirm_GetNamedItemValue(IDialogContext context, IAwaitable <bool> result) { if (await result) { await NamedItemsWorker.DoGetNamedItemValue(context); } context.Wait(MessageReceived); }
public async Task GetActiveCellValue(IDialogContext context, LuisResult result) { // Telemetry TelemetryHelper.TrackDialog(context, result, "Cells", "GetActiveCellValue"); string workbookId = String.Empty; context.UserData.TryGetValue <string>("WorkbookId", out workbookId); if (!(String.IsNullOrEmpty(workbookId))) { await NamedItemsWorker.DoGetNamedItemValue(context); context.Wait(MessageReceived); } else { context.Call <bool>(new ConfirmOpenWorkbookDialog(), AfterConfirm_GetActiveCellValue); } }