@@ -15,11 +15,6 @@ public static class CommandRunnerBuilderExtensions
1515 /// <param name="builder">命令行执行器构造的链式调用。</param>
1616 /// <typeparam name="T">命令处理器的类型。</typeparam>
1717 /// <returns>命令行执行器构造的链式调用。</returns>
18- /// <remarks>
19- /// 请注意,<see cref="CommandLine"/> 对象是不可变的,所以你需要使用这个方法的返回值,否则当你再次调用 AddHandler 时,之前添加的处理器将会丢失。<br/>
20- /// 如果你需要分多次添加处理器,请先调用 <see cref="CommandLine.ToRunner"/> 方法获得 <see cref="ICommandRunnerBuilder"/> 对象;
21- /// 在这个对象上多次调用 AddHandler 方法是安全的。
22- /// </remarks>
2318 public static IAsyncCommandRunnerBuilder AddHandler < T > ( this CommandLine builder )
2419 {
2520 throw CommandLine . MethodShouldBeInspected ( ) ;
@@ -34,7 +29,7 @@ public static IAsyncCommandRunnerBuilder AddHandler<T>(this CommandLine builder)
3429 /// <returns>命令行执行器构造的链式调用。</returns>
3530 public static StatedCommandRunnerBuilder < TState > ForState < TState > ( this CommandLine builder , TState state )
3631 {
37- return new StatedCommandRunnerBuilder < TState > ( builder . ToRunner ( ) . AsRunner ( ) , state ) ;
32+ return new StatedCommandRunnerBuilder < TState > ( ( ( ICommandRunnerBuilder ) builder ) . AsRunner ( ) , state ) ;
3833 }
3934
4035 /// <inheritdoc cref="AddHandler{T}(CommandLine,Func{T, Task{int}})" />
@@ -62,11 +57,6 @@ public static IAsyncCommandRunnerBuilder AddHandler<T>(this CommandLine builder,
6257 /// <param name="handler">用于处理已解析的命令行参数的委托。</param>
6358 /// <typeparam name="T">命令处理器的类型。</typeparam>
6459 /// <returns>命令行执行器构造的链式调用。</returns>
65- /// <remarks>
66- /// 请注意,<see cref="CommandLine"/> 对象是不可变的,所以你需要使用这个方法的返回值,否则当你再次调用 AddHandler 时,之前添加的处理器将会丢失。<br/>
67- /// 如果你需要分多次添加处理器,请先调用 <see cref="CommandLine.ToRunner"/> 方法获得 <see cref="ICommandRunnerBuilder"/> 对象;
68- /// 在这个对象上多次调用 AddHandler 方法是安全的。
69- /// </remarks>
7060 public static IAsyncCommandRunnerBuilder AddHandler < T > ( this CommandLine builder , Func < T , Task < int > > handler )
7161 {
7262 throw CommandLine . MethodShouldBeInspected ( ) ;
0 commit comments