public static IShellBuilder ModulesFromAssemblyOf(this IShellBuilder me, Type typeOfAssembly) { foreach (var module in typeOfAssembly.Assembly.GetTypes().Where(t => typeof(IModule).IsAssignableFrom(t))) { Module(me, module); } return(me); }
private static void ApplyParsedArguments(CommandLineOptions clo, IShellBuilder builder) { if (clo.PluginsPath?.Any() == true) { foreach (var path in clo.PluginsPath) { builder.UseConfiguration(sc => { sc.AddConfig(new SerializedConfiguration() { InnerShells = new List <InnerShellConfiguration>() { new InnerShellConfiguration() { Path = path } } }); }); } } }
/// <summary> /// Changes builder instance. /// </summary> /// <param name="newBuilder">New builder to set.</param> /// <exception cref="System.ArgumentNullException"> /// <paramref name="newBuilder" /> is <c>null</c>. /// </exception> public void ChangeShellBuilder(IShellBuilder newBuilder) { _shellBuilder = newBuilder.ThrowIfNull(nameof(newBuilder)); }
/// <summary> /// Initializes director with passed builder. /// </summary> /// <param name="shellBuilder">Instance of builder.</param> /// <exception cref="System.ArgumentNullException"> /// <paramref name="shellBuilder" /> is <c>null</c>. /// </exception> public ShellBuilderDirector(IShellBuilder shellBuilder) { _shellBuilder = shellBuilder.ThrowIfNull(nameof(shellBuilder)); }
public static IShellBuilder ShellFactory(this IShellBuilder me, out Func <ShellWindow> shellFactory) { shellFactory = ((ShellBuilder)me).GetShellWindow; ((ShellBuilder)me).ShowWindow = false; return(me); }
public static IShellBuilder ModulesFromAssemblyOf <T>(this IShellBuilder me) => ModulesFromAssemblyOf(me, typeof(T));
public static IShellBuilder Module <T>(this IShellBuilder me) where T : class, IModule => Module(me, typeof(T));
public static IShellBuilder Module(this IShellBuilder me, Type type) { me.FuxionBuilder.Services.AddSingleton(typeof(IModule), type); return(me); }