コード例 #1
0
ファイル: Extensions.cs プロジェクト: wagnerhsu/nuget-CliFx
        /// <summary>
        /// Configures application to use specified factory method for creating new instances of <see cref="ICommand"/>.
        /// </summary>
        public static ICliApplicationBuilder UseCommandFactory(this ICliApplicationBuilder builder, Func <CommandSchema, ICommand> factoryMethod)
        {
            builder.GuardNotNull(nameof(builder));
            factoryMethod.GuardNotNull(nameof(factoryMethod));

            return(builder.UseCommandFactory(new DelegateCommandFactory(factoryMethod)));
        }
コード例 #2
0
ファイル: Extensions.cs プロジェクト: thorhj/CliFx
 /// <summary>
 /// Configures application to use specified factory method for creating new instances of <see cref="ICommand"/>.
 /// </summary>
 public static ICliApplicationBuilder UseCommandFactory(this ICliApplicationBuilder builder, Func <CommandSchema, ICommand> factoryMethod) =>
 builder.UseCommandFactory(new DelegateCommandFactory(factoryMethod));