/// <summary> /// Converts answer of a TwoWay notification message, based on the bool value returned. /// </summary> /// <param name="value">if set to <c>true</c> [value].</param> /// <param name="possibleAnswers">The possible answers.</param> /// <returns></returns> protected NotificationTwoWayAnswersEnum ConvertBool2NotificationTwoWayAnswersEnum(bool value, NotificationTwoWayAnswersGroupEnum possibleAnswers) { return(possibleAnswers switch { NotificationTwoWayAnswersGroupEnum.Ok => value ? NotificationTwoWayAnswersEnum.Ok : NotificationTwoWayAnswersEnum.Unknown, NotificationTwoWayAnswersGroupEnum.YesNo => value ? NotificationTwoWayAnswersEnum.Yes : NotificationTwoWayAnswersEnum.No, NotificationTwoWayAnswersGroupEnum.OkCancel => value ? NotificationTwoWayAnswersEnum.Ok : NotificationTwoWayAnswersEnum.Cancel, _ => NotificationTwoWayAnswersEnum.Unknown, });
/// <summary> /// Initializes a new instance of the <see cref="NotificationGenericQuestionMessage" /> class. /// </summary> /// <param name="sender">The sender.</param> /// <param name="question">The question.</param> /// <param name="possibleAnswers">The possible answers.</param> public NotificationGenericQuestionMessage(object sender, string question, NotificationTwoWayAnswersGroupEnum possibleAnswers) : base(sender) { Question = question; PossibleAnswers = possibleAnswers; }