コード例 #1
0
        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);
            }
        }
コード例 #2
0
        public static bool ToBoolean(this SuccessOrFailure successOrFailure)
        {
            switch (successOrFailure)
            {
            case SuccessOrFailure.Failure:
                return(false);

            case SuccessOrFailure.Success:
                return(true);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(successOrFailure);
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
        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);
            }
        }
コード例 #10
0
 public UnexpectedEnumerationValueException(TEnum value)
     : this(EnumerationHelper.UnexpectedEnumerationValueMessage <TEnum>(value))
 {
     this.Value = value;
 }
コード例 #11
0
 public UnrecognizedEnumerationValueException(string enumerationTypeFullName, string unrecognizedValue)
     : this(EnumerationHelper.UnrecognizedEnumerationValueMessage(enumerationTypeFullName, unrecognizedValue))
 {
     this.EnumerationTypeFullName = enumerationTypeFullName;
     this.UnrecognizedValue       = unrecognizedValue;
 }