示例#1
0
        public static async Task <DialogContext> MakeContextAsync(IDialog root, IBotToUser botToUser)
        {
            var        data    = new JObjectBotData(new Connector.Message());
            IFiberLoop fiber   = new Fiber(new FrameFactory(new WaitFactory()));
            var        context = new DialogContext(botToUser, data, fiber);
            var        loop    = Methods.Void(Methods.Loop(context.ToRest(root.StartAsync), int.MaxValue));

            fiber.Call(loop, null);
            await fiber.PollAsync();

            return(context);
        }