Exemplo n.º 1
0
        private bool DoPrompt(PromptArgs args, StringBuilder output)
        {
            PromptResponse response = this.Protocol.SendClientRequestSync(new PromptRequest(args.Message));

            output.AppendLine("Response: " + response.Response.ToString());
            return(true);
        }
Exemplo n.º 2
0
        public PromptResponse ToPromptResponse()
        {
            var res = new PromptResponse();

            Questions.ForEach(q => res.AddAnswer(q.Key, q.Answer ?? ""));
            return(res);
        }
Exemplo n.º 3
0
        public void CanAddAnswers()
        {
            var          result = new PromptResponse();
            const string key    = "q";
            var          p      = new PromptQuery("hey", key: key);

            result.AddAnswer(p, "hi");

            Assert.Equal("hi", result.Answers[key]);
        }
Exemplo n.º 4
0
 private void btnNo_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         this.Response     = PromptResponse.No;
         this.DialogResult = true;
     }
     catch (Exception ex)
     {
         Toolbox.LogException(ex);
     }
 }
Exemplo n.º 5
0
 private void btnCustom2_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         this.Response = PromptResponse.Custom2;
         Toolbox.uAddDebugLog($"User chose option: {this.Response.ToString()}");
         this.DialogResult = true;
     }
     catch (Exception ex)
     {
         Toolbox.LogException(ex);
     }
 }
Exemplo n.º 6
0
        public static async Task <IActionResult> ReceivePromptResponse(
            [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "{abilityKey}/{actionKey}/{promptKey}")] PromptResponse req,
            string abilityKey,
            string actionKey,
            string promptKey,
            CancellationToken cancellationToken)
        {
            using (var scope = Startup.Services.CreateScope())
            {
                await scope
                .ServiceProvider
                .GetService <IAbilityDispatcher>()
                .PromptResponse(req, abilityKey, actionKey, promptKey, cancellationToken);
            }

            return(new OkResult());
        }