예제 #1
0
        public async Task MessageReceivedAsync(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var msg = await result;

            string[] options = new string[] { "Image", "Paragraph" };
            string   prompt  = $"I see you are running the Clippy Bot in Word. Which of the following would you like me to insert into Word:";

            PromptDialog.Choice(context, async(IDialogContext choiceContext, IAwaitable <string> choiceResult) =>
            {
                var selection      = await choiceResult;
                OfficeOperation op = (OfficeOperation)Enum.Parse(typeof(OfficeOperation), selection);

                // Send the operation through the backchannel using Event activity
                var reply   = choiceContext.MakeMessage() as IEventActivity;
                reply.Type  = "event";
                reply.Name  = "officeOperation";
                reply.Value = op.ToString();
                await choiceContext.PostAsync((IMessageActivity)reply);
            }, options, prompt);
        }
        public async Task MessageReceivedAsync(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var msg = await result;

            string[] options = new string[] { "Chart", "Range" };
            string   prompt  = $"I see you are running the Clippy Bot in Excel. Select something and I'll insert it into a *NEW* worksheet:";

            PromptDialog.Choice(context, async(IDialogContext choiceContext, IAwaitable <string> choiceResult) =>
            {
                var selection      = await choiceResult;
                OfficeOperation op = (OfficeOperation)Enum.Parse(typeof(OfficeOperation), selection);

                // Send the operation through the backchannel using Event activity
                var reply   = choiceContext.MakeMessage() as IEventActivity;
                reply.Type  = "event";
                reply.Name  = "officeOperation";
                reply.Value = op.ToString();
                await choiceContext.PostAsync((IMessageActivity)reply);
            }, options, prompt);
        }
예제 #3
0
        public async Task MessageReceivedAsync(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var msg = await result;

            string[] options = new string[] { "Reply", "Reply All" };
            var      user    = context.UserData.Get <string>("user");
            string   prompt  = $"Hey {user}, I see you are running the Clippy Bot in Outlook. For this mail, I can help you with the following:";

            PromptDialog.Choice(context, async(IDialogContext choiceContext, IAwaitable <string> choiceResult) =>
            {
                var selection      = await choiceResult;
                OfficeOperation op = (OfficeOperation)Enum.Parse(typeof(OfficeOperation), selection.Replace(" ", ""));

                // Send the operation through the backchannel using Event activity
                var reply   = choiceContext.MakeMessage() as IEventActivity;
                reply.Type  = "event";
                reply.Name  = "officeOperation";
                reply.Value = op.ToString();
                await choiceContext.PostAsync((IMessageActivity)reply);
            }, options, prompt);
        }