Esempio n. 1
0
 public CommandLineTypeMatchResult(VerbMatchingResult matchingResult, Type verbType, string?verb, Func <T> handler)
 {
     if (matchingResult != VerbMatchingResult.Matched && matchingResult != VerbMatchingResult.FallbackMatched)
     {
         throw new ArgumentException("当使用此重载时,只有 VerbMatched 和 NonVerbMatched 是有效的参数值。", nameof(matchingResult));
     }
     MachingResult = matchingResult;
     VerbType      = verbType ?? throw new ArgumentNullException(nameof(verbType));
     Verb          = verb;
     Handler       = handler ?? throw new ArgumentNullException(nameof(handler));
 }
Esempio n. 2
0
 public CommandLineTypeMatchResult(VerbMatchingResult matchingResult, Type verbType, string?verb)
 {
     if (matchingResult != VerbMatchingResult.NotMatch)
     {
         throw new ArgumentException("当使用此重载时,VerbMatchingResult.NotMatched 是唯一有效的参数值。", nameof(matchingResult));
     }
     MachingResult = matchingResult;
     VerbType      = verbType ?? throw new ArgumentNullException(nameof(verbType));
     Verb          = verb;
     Handler       = null;
 }