コード例 #1
0
        public static async Task <T> RunConditionalPattern(T entry, PatternConditionalDelegate <T> patternConditionalDelegate,
                                                           PatternResultDelegate <T> patternPassedResultDelegate,
                                                           PatternDelegate <T> patternFailedDelegate)
        {
            var pattern = new ConditionalPattern <T>(patternPassedResultDelegate, patternFailedDelegate);

            return(await pattern.Run(patternConditionalDelegate, entry));
        }
コード例 #2
0
        public static async Task <T> RunConditionalPattern(T entry,
                                                           PatternResultDelegate <T> patternPassedResultDelegate,
                                                           PatternDelegate <T> patternFailedDelegate, params IConditionalException <T>[] conditionalExceptions)
        {
            var pattern = new ConditionalPattern <T>(patternPassedResultDelegate, patternFailedDelegate);

            return(await pattern.Run(entry, patternConditionalDelegates : conditionalExceptions));
        }
コード例 #3
0
 private ConditionalPattern(PatternResultDelegate <T> patternPassedResultDelegate,
                            PatternDelegate <T> patternFailedDelegate)
 {
     _patternPassedResultDelegate = patternPassedResultDelegate;
     _patternFailedDelegate       = patternFailedDelegate;
 }