コード例 #1
0
        // 14 Feb 2013 - Michael Cullen - Modified to fix Bug 8809
        public void InvokeFeedback(IFeedbackAction emailFeedbackAction, IAsyncFeedbackAction recordedFeedbackAction)
        {
            // The person clicked the Feedback button
            if (emailFeedbackAction == null)
            {
                throw new ArgumentNullException("emailFeedbackAction");
            }

            if (recordedFeedbackAction == null)
            {
                throw new ArgumentNullException("recordedFeedbackAction");
            }

            IFeedbackAction actionToInvoke = null;

            if (recordedFeedbackAction.CanProvideFeedback)
            {
                IAsyncFeedbackAction asyncFeedback = CurrentAction as IAsyncFeedbackAction;
                if (asyncFeedback != null) // If a recording session is already in progress, ask the user if he wants to stop it.
                {
                    MessageBoxResult result = Popup.Show("Another feedback session is in progress - Would you like to stop it?", "Feedback in Progress", MessageBoxButton.YesNo, MessageBoxImage.Question, null);
                    if (result == MessageBoxResult.Yes)
                    {
                        asyncFeedback.FinishFeedBack();
                    }
                }
                else // Else give him the normal message asking what he wants to do.
                {
                    MessageBoxResult result = Popup.Show("The ability to give feedback by recording steps is available on your system - Would you like to use it?", "Recorded Feedback", MessageBoxButton.YesNoCancel, MessageBoxImage.Question, null);

                    if (result == MessageBoxResult.Yes)
                    {
                        actionToInvoke = recordedFeedbackAction;
                    }
                    else if (result == MessageBoxResult.No)
                    {
                        actionToInvoke = emailFeedbackAction;
                    }
                }
            }
            else
            {
                actionToInvoke = emailFeedbackAction;
            }

            if (actionToInvoke == null)
            {
                return;
            }

            InvokeFeedbackImpl(actionToInvoke);
        }
コード例 #2
0
 public static void ProvideFeedback(string text)
 {
     if (feedbackAction == null)
     {
         // synchronize to avoid duplicate calls
         lock (syncLock)
         {
             if (feedbackAction == null)
             {
                 var value = ConfigurationManager.AppSettings["FeedbackAction"];
                 feedbackAction = GetFeedbackAction(value);
             }
         }
     }
     feedbackAction.ProvideFeedback(text);
 }
コード例 #3
0
        private void InvokeAction(IFeedbackAction feedbackAction)
        {
            IAsyncFeedbackAction asyncFeedbackAction = feedbackAction as IAsyncFeedbackAction;

            if (asyncFeedbackAction == null)
            {
                CurrentAction = feedbackAction;
                feedbackAction.StartFeedback();
                CurrentAction = null;
            }
            else
            {
                CurrentAction = asyncFeedbackAction;
                asyncFeedbackAction.StartFeedback(e =>
                {
                    CurrentAction = null;
                });
            }
        }
コード例 #4
0
        private void InvokeFeedbackImpl(IFeedbackAction feedbackAction)
        {
            if (feedbackAction == null)
            {
                throw new ArgumentNullException("feedbackAction");
            }

            if (!feedbackAction.CanProvideFeedback)
            {
                Popup.Show("Unable to provide feedback at this time.", "Feedback Unavailable", MessageBoxButton.OK, MessageBoxImage.Error, null);
                return;
            }

            if (!EnsureNoFeedbackSessionsInProgress())
            {
                return;
            }

            InvokeAction(feedbackAction);
        }
コード例 #5
0
 public void InvokeFeedback(IFeedbackAction feedbackAction)
 {
     InvokeFeedbackImpl(feedbackAction);
 }