// 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); }
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; }); } }
private bool EnsureNoFeedbackSessionsInProgress() { if (CurrentAction == null) { return(true); } MessageBoxResult result = Popup.Show("Another feedback session is in progress - Would you like to cancel it?", "Feedback in Progress", MessageBoxButton.YesNo, MessageBoxImage.Error, null); if (result == MessageBoxResult.No) { return(false); } IAsyncFeedbackAction asyncFeedback = CurrentAction as IAsyncFeedbackAction; if (asyncFeedback != null) { asyncFeedback.CancelFeedback(); } return(true); }
public void InvokeFeedback(IAsyncFeedbackAction feedbackAction) { InvokeFeedbackImpl(feedbackAction); }