Пример #1
0
 public static Bootstrapper AddDefaults(this Bootstrapper bootstrapper, DefaultFeatures features = DefaultFeatures.All)
 {
     _ = bootstrapper ?? throw new ArgumentNullException(nameof(bootstrapper));
     if (features.HasFlag(DefaultFeatures.BootstrapperConfigurators))
     {
         bootstrapper.AddBootstrapperConfigurators();
     }
     if (features.HasFlag(DefaultFeatures.Logging))
     {
         bootstrapper.AddDefaultLogging();
     }
     if (features.HasFlag(DefaultFeatures.Settings))
     {
         bootstrapper.AddDefaultSettings();
     }
     if (features.HasFlag(DefaultFeatures.EnvironmentVariables))
     {
         bootstrapper.AddEnvironmentVariables();
     }
     if (features.HasFlag(DefaultFeatures.ConfigurationFiles))
     {
         bootstrapper.AddDefaultConfigurationFiles();
     }
     if (features.HasFlag(DefaultFeatures.BuildCommands))
     {
         bootstrapper.AddBuildCommands();
     }
     if (features.HasFlag(DefaultFeatures.HostingCommands))
     {
         bootstrapper.AddHostingCommands();
     }
     if (features.HasFlag(DefaultFeatures.CustomCommands))
     {
         bootstrapper.AddCustomCommands();
     }
     if (features.HasFlag(DefaultFeatures.Shortcodes))
     {
         bootstrapper.AddDefaultShortcodes();
     }
     if (features.HasFlag(DefaultFeatures.Namespaces))
     {
         bootstrapper.AddDefaultNamespaces();
     }
     if (features.HasFlag(DefaultFeatures.Pipelines))
     {
         bootstrapper.AddDefaultPipelines();
     }
     return(bootstrapper);
 }
Пример #2
0
 public static Bootstrapper AddDefaultsWithout(this Bootstrapper bootstrapper, DefaultFeatures withoutFeatures) =>
 bootstrapper.AddDefaults(DefaultFeatures.All & ~withoutFeatures);
Пример #3
0
 /// <summary>
 /// Creates a bootstrapper with a default configuration including logging, commands,
 /// shortcodes, and assembly scanning.
 /// </summary>
 /// <param name="args">The command line arguments.</param>
 /// <param name="features">The default configurations to add to the bootstrapper.</param>
 /// <returns>The bootstrapper.</returns>
 public static IBootstrapper CreateDefault(string[] args, DefaultFeatures features = DefaultFeatures.All) =>
 Create(args).AddDefaults(features);
Пример #4
0
 public static IBootstrapper CreateDefaultWithout(string[] args, DefaultFeatures features) =>
 Create(args).AddDefaultsWithout(features);
Пример #5
0
 public static Bootstrapper CreateDefaultWithout(this BootstrapperFactory factory, string[] args, DefaultFeatures features) =>
 factory.Create(args).AddDefaultsWithout(features);