public static string ToStandardRepresentation(SuccessOrFailure successOrFailure)
        {
            switch (successOrFailure)
            {
            case SuccessOrFailure.Failure:
                return(SuccessOrFailureHelper.StandardRepresentation.Failure);

            case SuccessOrFailure.Success:
                return(SuccessOrFailureHelper.StandardRepresentation.Success);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(successOrFailure);
            }
        }
        public static bool ToBoolean(this SuccessOrFailure successOrFailure)
        {
            switch (successOrFailure)
            {
            case SuccessOrFailure.Failure:
                return(false);

            case SuccessOrFailure.Success:
                return(true);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(successOrFailure);
            }
        }
        public static SuccessOrFailure FromStandardRepresentation(string standardRepresentation)
        {
            switch (standardRepresentation)
            {
            case SuccessOrFailureHelper.StandardRepresentation.Failure:
                return(SuccessOrFailure.Failure);

            case SuccessOrFailureHelper.StandardRepresentation.Success:
                return(SuccessOrFailure.Success);

            default:
                throw EnumerationHelper.RepresentationUnrecognizedException <ApprovalStatus>(standardRepresentation);
            }
        }
Ejemplo n.º 4
0
        public static ApprovalStatus FromStandardRepresentation(string approvalStatusStandardRepresenation)
        {
            switch (approvalStatusStandardRepresenation)
            {
            case ApprovalStatusHelper.StandardRepresentation.Approved:
                return(ApprovalStatus.Approved);

            case ApprovalStatusHelper.StandardRepresentation.Denied:
                return(ApprovalStatus.Denied);

            case ApprovalStatusHelper.StandardRepresentation.Pending:
                return(ApprovalStatus.Pending);

            default:
                throw EnumerationHelper.RepresentationUnrecognizedException <ApprovalStatus>(approvalStatusStandardRepresenation);
            }
        }
Ejemplo n.º 5
0
        public static string ToStandardRepresentation(ApprovalStatus approvalStatus)
        {
            switch (approvalStatus)
            {
            case ApprovalStatus.Approved:
                return(ApprovalStatusHelper.StandardRepresentation.Approved);

            case ApprovalStatus.Denied:
                return(ApprovalStatusHelper.StandardRepresentation.Denied);

            case ApprovalStatus.Pending:
                return(ApprovalStatusHelper.StandardRepresentation.Pending);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(approvalStatus);
            }
        }
Ejemplo n.º 6
0
        public static T Switch <T>(this ApprovalStatus approvalStatus, T approved, T denied, T pending)
        {
            switch (approvalStatus)
            {
            case ApprovalStatus.Approved:
                return(approved);

            case ApprovalStatus.Denied:
                return(denied);

            case ApprovalStatus.Pending:
                return(pending);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(approvalStatus);
            }
        }
Ejemplo n.º 7
0
        public static T Switch <T>(this OrganizationCourtStatus organizationCourtStatus, T approved, T denied, T pending)
        {
            switch (organizationCourtStatus)
            {
            case OrganizationCourtStatus.Approved:
                return(approved);

            case OrganizationCourtStatus.Denied:
                return(denied);

            case OrganizationCourtStatus.DeniedWithReroute:
                return(denied);

            case OrganizationCourtStatus.Pending:
                return(pending);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(organizationCourtStatus);
            }
        }
        public static OrganizationCourtStatus FromStandardRepresentation(string organizationCourtStatusStandardRepresenation)
        {
            switch (organizationCourtStatusStandardRepresenation)
            {
            case OrganizationCourtStatusHelper.StandardRepresentation.Approved:
                return(OrganizationCourtStatus.Approved);

            case OrganizationCourtStatusHelper.StandardRepresentation.Denied:
                return(OrganizationCourtStatus.Denied);

            case OrganizationCourtStatusHelper.StandardRepresentation.DeniedWithReroute:
                return(OrganizationCourtStatus.DeniedWithReroute);

            case OrganizationCourtStatusHelper.StandardRepresentation.Pending:
                return(OrganizationCourtStatus.Pending);

            default:
                throw EnumerationHelper.RepresentationUnrecognizedException <OrganizationCourtStatus>(organizationCourtStatusStandardRepresenation);
            }
        }
        public static string ToStandardRepresentation(OrganizationCourtStatus organizationCourtStatus)
        {
            switch (organizationCourtStatus)
            {
            case OrganizationCourtStatus.Approved:
                return(OrganizationCourtStatusHelper.StandardRepresentation.Approved);

            case OrganizationCourtStatus.Denied:
                return(OrganizationCourtStatusHelper.StandardRepresentation.Denied);

            case OrganizationCourtStatus.DeniedWithReroute:
                return(OrganizationCourtStatusHelper.StandardRepresentation.DeniedWithReroute);

            case OrganizationCourtStatus.Pending:
                return(OrganizationCourtStatusHelper.StandardRepresentation.Pending);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(organizationCourtStatus);
            }
        }
 public UnexpectedEnumerationValueException(TEnum value)
     : this(EnumerationHelper.UnexpectedEnumerationValueMessage <TEnum>(value))
 {
     this.Value = value;
 }
 public UnrecognizedEnumerationValueException(string enumerationTypeFullName, string unrecognizedValue)
     : this(EnumerationHelper.UnrecognizedEnumerationValueMessage(enumerationTypeFullName, unrecognizedValue))
 {
     this.EnumerationTypeFullName = enumerationTypeFullName;
     this.UnrecognizedValue       = unrecognizedValue;
 }