Exemplo n.º 1
0
        private async Task AfterCertificationDialog(IDialogContext context, IAwaitable <string> result)
        {
            var answerFound = await result;
            //不显示流程完毕的提示,避免微信中多条回复导致报错
            //await context.PostAsync(answerFound);
            var fbDialog = new FeedbackDialog();
            await context.Forward(fbDialog, AfterFeedbackDialog, new Activity(), System.Threading.CancellationToken.None);

            //context.Wait(this.MessageReceivedAsync);
        }
Exemplo n.º 2
0
        protected override void OnActivated()
        {
            base.OnActivated();

            FeedbackDialog fbd = new FeedbackDialog();

            int result = fbd.Run();

            if (result == (int)ResponseType.Ok)
            {
            }
            fbd.Destroy();
        }
Exemplo n.º 3
0
 public static void ShowFeedbackWindow()
 {
     if (currentFeedbackDialog == null)
     {
         var p = FeedbackPositionGetter();
         currentFeedbackDialog = new FeedbackDialog(p.X, p.Y);
         currentFeedbackDialog.Show();
         currentFeedbackDialog.Destroyed += delegate {
             currentFeedbackDialog = null;
         };
     }
     else
     {
         currentFeedbackDialog.Show();
     }
 }
Exemplo n.º 4
0
        public Program()
        {
            var regDlg = new RegistrationDialog(this);
            var fbDlg = new FeedbackDialog(this);
            var tüDlg = new TrainingsübersichtDialog(this);
            var trDlg = new TrainingDialog(this);
            var rDlg = new RootDialog(this);

            regDlg.OnShowRequest += regDlg.Show;
            regDlg.OnRegistrationRequest += (tid, name, email) => {
                if (name == "x")
                    regDlg.Retry("someMatchcode", name, email, string.Format("Received: {0}, {1}, {2}", tid, name, email));
                else
                    regDlg.Ack("someMatchcode", name, email);
            };

            fbDlg.OnShowRequest += fbDlg.Show;
            fbDlg.OnFeedbackRequest += (tmatchcode, email, score, suggestions) =>
            {
                if (email == "x")
                    fbDlg.Retry(tmatchcode, email, score, suggestions, string.Format("Received: {0}, {1}, {2}, {3}", tmatchcode, email, score, suggestions));
                else
                    fbDlg.Ack(tmatchcode);
            };

            tüDlg.OnShowRequest += trainerMatchcode => tüDlg.Show(trainerMatchcode,
                new[] { new Tuple<string, string>("1", "training1"), new Tuple<string, string>("2", "training2") }, 
                "");
            tüDlg.OnTrainingCreationRequest += (trainerMatchcode, newTrainingMatchcode) => tüDlg.Show(trainerMatchcode, new[] { new Tuple<string, string>("1", "training1"), new Tuple<string, string>("2", "training2"), new Tuple<string, string>("3", newTrainingMatchcode), },
                                                                                                                    newTrainingMatchcode == "x" ? "Training matchcode already existent." : "");

            trDlg.OnShowRequest += trainingId =>
                {
                    var ti = new TrainingInfo {
                        Matchcode = "someTraining",
                        Votes = new[]
                            {
                                new VoteInfo {Name = "n1", Email = "e1@", Score = 6, Suggestions = "s1"},
                                new VoteInfo {Name = "n2", Email = "e2@", Score = 7, Suggestions = "s2"},
                            },
                        AverageScore = 6.5
                    };
                    trDlg.Show(ti);
                };

            Get["/hello"] = _ => "Hello from instavote.dialogs.tests, " + DateTime.Now;
        }
Exemplo n.º 5
0
        private static void DisplayFeedbackDialog(int commandId, IEnumerable <SarifErrorListItem> sarifErrorListItems)
        {
            FeedbackInfo feedbackInfo = s_commandToResultDescriptionDictionary[commandId];
            string       title        = string.Format(Resources.ReportResultTitle, feedbackInfo.Description);

            var feedback = new FeedbackModel(
                sarifErrorListItems.GetCombinedRuleIds(),
                sarifErrorListItems.GetCombinedToolNames(),
                sarifErrorListItems.GetCombinedToolVersions(),
                sarifErrorListItems.GetCombinedSnippets(),
                feedbackInfo.FeedbackType,
                feedbackInfo.Summary,
                CodeAnalysisResultManager.Instance.GetPartitionedLog(sarifErrorListItems));

            var feedbackDialog = new FeedbackDialog(title, feedback);

            feedbackDialog.ShowModal();
        }
Exemplo n.º 6
0
        private async void FeedbackDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            try
            {
                var log = await FileIOHelper.CreateCacheFileAsync(Guid.NewGuid().ToString() + "_Feedback");

                if (!ReportBox.Text.IsNullorEmpty())
                {
                    await FileIO.AppendTextAsync(log, "User Voice = " + ReportBox.Text + Environment.NewLine);

                    if (!EmailBox.Text.IsNullorEmpty())
                    {
                        if (new EmailAddressAttribute().IsValid(EmailBox.Text))
                        {
                            await FileIO.AppendTextAsync(log, "Email = " + EmailBox.Text + Environment.NewLine);

                            var fileBytes = await FileIOHelper.GetBytesAsync(log);

                            WebHelper.UploadFilesToServer(new Uri(Utils.UPLOAD_CRASH), null, log.Name, "application/octet-stream", fileBytes);
                        }
                        else
                        {
                            EmailBox.PlaceholderText = "Invalid Email address!";
                            await FeedbackDialog.ShowAsync();
                        }
                    }
                    else
                    {
                        EmailBox.PlaceholderText = "Invalid Email address!";
                        await FeedbackDialog.ShowAsync();
                    }
                }
                else
                {
                    ReportBox.PlaceholderText = "Input some opinion";
                    await FeedbackDialog.ShowAsync();
                }
            }
            catch (Exception)
            {
                FeedbackDialog.PrimaryButtonText = "Failed";
                await FeedbackDialog.ShowAsync();
            }
        }
Exemplo n.º 7
0
        public static void ShowFeedbackWindow()
        {
            if (string.IsNullOrEmpty(feedbackUrl.Value))
            {
                return;
            }

            if (currentFeedbackDialog == null)
            {
                var p = FeedbackPositionGetter();
                currentFeedbackDialog = new FeedbackDialog(p.X, p.Y);
                currentFeedbackDialog.Show();
                currentFeedbackDialog.Destroyed += delegate {
                    currentFeedbackDialog = null;
                };
            }
            else
            {
                currentFeedbackDialog.Show();
            }
        }
Exemplo n.º 8
0
            private void FeedbackButton_Click(object sender, System.EventArgs e)
            {
                FeedbackDialog feedbackDialog = new FeedbackDialog();

                feedbackDialog.Show(mFragmentManager, "Feedback fragment");
            }
Exemplo n.º 9
0
 private async void FeedbackButton_Click(object sender, RoutedEventArgs e)
 {
     ReportBox.Text = string.Empty;
     EmailBox.Text  = string.Empty;
     await FeedbackDialog.ShowAsync();
 }
Exemplo n.º 10
0
 private void FeedbackDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
 {
     FeedbackDialog.Hide();
 }