Example #1
0
        private void UserDialogExitProcessing(PopdownReason popdownReason)
        {
            // Log to Honorbuddy why we're exiting behavior...
            if (popdownReason.IsReasonKnown())
            {
                string directiveRequester = (IsStopOnContinue ? "Profile Writer request"
                                                        : popdownReason.IsPopdown() ? "Notification criteria no longer valid"
                                                        : popdownReason.IsTimerExpiry() ? "Profile Writer request"
                                                        : popdownReason.IsUserResponse() ? "User request"
                                                        : "Profile Writer request");
                string messageType = (popdownReason.IsTimerExpiry() ? "timer expired"
                                                        : popdownReason.IsUserResponse() ? "user response"
                                                        : popdownReason.IsPopdown() ? "completion criteria"
                                                        : "info");
                string terminationMessage = string.Format("{0} {1}",
                                                          (popdownReason.IsBotStop() ? "Honorbuddy stopped due to "
                                                                     : "Continuing profile due to"),
                                                          directiveRequester);

                TreeRoot.StatusText = terminationMessage;
                LogMessage(messageType, terminationMessage);
            }

            if (popdownReason.IsBotStop())
            {
                TreeRoot.Stop();
            }
        }
        private void UserDialogExitProcessing(PopdownReason popdownReason)
        {
            // Log to Honorbuddy why we're exiting behavior...
            if (popdownReason.IsReasonKnown())
            {
                string directiveRequester = (IsStopOnContinue ? "Profile Writer request"
                                                        : popdownReason.IsPopdown() ? "Notification criteria no longer valid"
                                                        : popdownReason.IsTimerExpiry() ? "Profile Writer request"
                                                        : popdownReason.IsUserResponse() ? "User request"
                                                        : "Profile Writer request");
                string messageType = (popdownReason.IsTimerExpiry() ? "timer expired"
                                                        : popdownReason.IsUserResponse() ? "user response"
                                                        : popdownReason.IsPopdown() ? "completion criteria"
                                                        : "info");
                string terminationMessage = string.Format("{0} {1}",
                                                          (popdownReason.IsBotStop() ? "Honorbuddy stopped due to "
                                                                     : "Continuing profile due to"),
                                                          directiveRequester);

                TreeRoot.StatusText = terminationMessage;

                DialogText = DialogText.Replace(@"\n", System.Environment.NewLine).Replace(@"\t", "\t");
                QBCLog.DeveloperInfo("[{0}, {1}] {2}\nDisposition: {3}", DialogTitle, messageType, DialogText, terminationMessage);
            }

            if (popdownReason.IsBotStop())
            {
                TreeRoot.Stop();
            }
        }
Example #3
0
 public static bool IsUserResponse(this PopdownReason popdownReason)
 {
     return((popdownReason == PopdownReason.BotStopViaUser) ||
            (popdownReason == PopdownReason.ContinueViaUser));
 }
Example #4
0
 public static bool IsTimerExpiry(this PopdownReason popdownReason)
 {
     return((popdownReason == PopdownReason.BotStopViaExpiry) ||
            (popdownReason == PopdownReason.ContinueViaExpiry));
 }
Example #5
0
 public static bool IsPopdown(this PopdownReason popdownReason)
 {
     return((popdownReason == PopdownReason.PopdownAndDispose) ||
            (popdownReason == PopdownReason.PopdownCompletionCriteriaMet));
 }
Example #6
0
 public static bool IsReasonKnown(this PopdownReason popdownReason)
 {
     return(popdownReason != PopdownReason.UNKNOWN);
 }
Example #7
0
 public static bool IsContinue(this PopdownReason popdownReason)
 {
     return((popdownReason == PopdownReason.ContinueViaExpiry) ||
            (popdownReason == PopdownReason.ContinueViaUser));
 }
Example #8
0
 public static bool IsBotStop(this PopdownReason popdownReason)
 {
     return((popdownReason == PopdownReason.BotStopViaExpiry) ||
            (popdownReason == PopdownReason.BotStopViaUser));
 }