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(); } }
public static bool IsUserResponse(this PopdownReason popdownReason) { return((popdownReason == PopdownReason.BotStopViaUser) || (popdownReason == PopdownReason.ContinueViaUser)); }
public static bool IsTimerExpiry(this PopdownReason popdownReason) { return((popdownReason == PopdownReason.BotStopViaExpiry) || (popdownReason == PopdownReason.ContinueViaExpiry)); }
public static bool IsPopdown(this PopdownReason popdownReason) { return((popdownReason == PopdownReason.PopdownAndDispose) || (popdownReason == PopdownReason.PopdownCompletionCriteriaMet)); }
public static bool IsReasonKnown(this PopdownReason popdownReason) { return(popdownReason != PopdownReason.UNKNOWN); }
public static bool IsContinue(this PopdownReason popdownReason) { return((popdownReason == PopdownReason.ContinueViaExpiry) || (popdownReason == PopdownReason.ContinueViaUser)); }
public static bool IsBotStop(this PopdownReason popdownReason) { return((popdownReason == PopdownReason.BotStopViaExpiry) || (popdownReason == PopdownReason.BotStopViaUser)); }