Ejemplo n.º 1
0
        public async Task SetCellStringValue(IDialogContext context, LuisResult result)
        {
            // Telemetry
            TelemetryHelper.TrackDialog(context, result, "Cells", "SetCellStringValue");

            var cellAddress = LuisHelper.GetCellEntity(result.Entities);

            context.UserData.SetValue <string>("CellAddress", cellAddress);

            context.UserData.SetValue <ObjectType>("Type", ObjectType.Cell);
            context.UserData.SetValue <string>("Name", cellAddress);

            Value = LuisHelper.GetValue(result);

            string workbookId = String.Empty;

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

            if (!(String.IsNullOrEmpty(workbookId)))
            {
                if (cellAddress != null)
                {
                    await CellWorker.DoSetCellValue(context, Value);
                }
                else
                {
                    await context.PostAsync($"You need to provide the name of a cell to set the value");
                }
                context.Wait(MessageReceived);
            }
            else
            {
                context.Call <bool>(new ConfirmOpenWorkbookDialog(), AfterConfirm_SetCellStringValue);
            }
        }
Ejemplo n.º 2
0
 public async Task AfterConfirm_SetCellStringValue(IDialogContext context, IAwaitable <bool> result)
 {
     if (await result)
     {
         await CellWorker.DoSetCellValue(context, Value);
     }
     context.Wait(MessageReceived);
 }