Пример #1
0
        public static async System.Threading.Tasks.Task <R> MatchAsync <R>(this ICheckLanguageResult self, System.Func <SafeText, System.Threading.Tasks.Task <R> > whenSafeText)
        {
            switch ((self))
            {
            case SafeText safetext:
                return(await whenSafeText(safetext));

            default:
                throw new System.NotSupportedException("This switch statement should be exhaustive");
            }
        }
Пример #2
0
        public static R Match <R>(this ICheckLanguageResult self, System.Func <SafeText, R> whenSafeText)
        {
            switch ((self))
            {
            case SafeText safetext:
                return(whenSafeText(safetext));

            default:
                throw new System.NotSupportedException("This switch statement should be exhaustive");
            }
        }
        public static async System.Threading.Tasks.Task <R> MatchAsync <R>(this ICheckLanguageResult self, System.Func <TextChecked, System.Threading.Tasks.Task <R> > whenTextChecked, System.Func <CheckFailed, System.Threading.Tasks.Task <R> > whenCheckFailed)
        {
            switch ((self))
            {
            case TextChecked textchecked:
                return(await whenTextChecked(textchecked));

            case CheckFailed checkfailed:
                return(await whenCheckFailed(checkfailed));

            default:
                throw new System.NotSupportedException("This switch statement should be exhaustive");
            }
        }
        public static ICheckLanguageResult Match(this ICheckLanguageResult self, System.Func <TextChecked, ICheckLanguageResult> whenTextChecked, System.Func <CheckFailed, ICheckLanguageResult> whenCheckFailed)
        {
            switch ((self))
            {
            case TextChecked textchecked:
                return(whenTextChecked(textchecked));

            case CheckFailed checkfailed:
                return(whenCheckFailed(checkfailed));

            default:
                throw new System.NotSupportedException("This switch statement should be exhaustive");
            }
        }
Пример #5
0
        public static async System.Threading.Tasks.Task <R> MatchAsync <R>(this ICheckLanguageResult self, System.Func <ValidReply, System.Threading.Tasks.Task <R> > whenValidReply, System.Func <InvalidReply, System.Threading.Tasks.Task <R> > whenInvalidReply, System.Func <ManualReview, System.Threading.Tasks.Task <R> > whenManualReview)
        {
            switch ((self))
            {
            case ValidReply validreply:
                return(await whenValidReply(validreply));

            case InvalidReply invalidreply:
                return(await whenInvalidReply(invalidreply));

            case ManualReview manualreview:
                return(await whenManualReview(manualreview));

            default:
                throw new System.NotSupportedException("This switch statement should be exhaustive");
            }
        }