/// <summary> /// Called when the module is unloaded from a kernel. /// </summary> /// <param name="kernelConfiguration">The kernel configuration that is unloading the module.</param> public void OnUnload(IKernelConfiguration kernelConfiguration) { this.Unload(); this.Bindings.Map(this.KernelConfiguration.RemoveBinding); this.KernelConfiguration = null; }
/// <summary> /// Loads modules from the files that match the specified pattern(s). /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which the module is loaded.</param> /// <param name="filePatterns">The file patterns (i.e. "*.dll", "modules/*.rb") to match.</param> public static void Load(this IKernelConfiguration kernelConfiguration, params string[] filePatterns) { Ensure.ArgumentNotNull(kernelConfiguration, "kernelConfiguration"); kernelConfiguration.Load(filePatterns); }
/// <summary> /// Loads modules defined in the specified assemblies. /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which the module is loaded.</param> /// <param name="assemblies">The assemblies to search.</param> public static void Load(this IKernelConfiguration kernelConfiguration, params Assembly[] assemblies) { Ensure.ArgumentNotNull(kernelConfiguration, "kernelConfiguration"); kernelConfiguration.Load(assemblies); }
/// <summary> /// Initializes a new instance of the <see cref="KernelBase"/> class. /// </summary> /// <param name="components">The component container to use.</param> /// <param name="settings">The configuration to use.</param> /// <param name="modules">The modules to load into the kernel.</param> protected KernelBase(IComponentContainer components, INinjectSettings settings, params INinjectModule[] modules) { this.kernelConfiguration = new KernelConfiguration(components, settings, modules); this.kernelConfiguration.Bind <IKernel>().ToMethod(ctx => this); this.kernelConfiguration.Bind <IResolutionRoot>().ToMethod(ctx => this).When(ctx => true); }
/// <summary> /// Initializes a new instance of the <see cref="CompiledModuleLoaderPlugin"/> class. /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which modules will be loaded.</param> /// <param name="assemblyNameRetriever">The assembly name retriever.</param> public CompiledModuleLoaderPlugin(IKernelConfiguration kernelConfiguration, IAssemblyNameRetriever assemblyNameRetriever) { this.KernelConfiguration = kernelConfiguration; this.assemblyNameRetriever = assemblyNameRetriever; }
/// <summary> /// Called when the module is unloaded from a kernel. /// </summary> /// <param name="kernelConfiguration">The kernel configuration that is unloading the module.</param> public void OnUnload(IKernelConfiguration kernelConfiguration) { this.Unload(); this.Bindings.Map(this.KernelConfiguration.RemoveBinding); this.KernelConfiguration = null; }
public static void BindToMethod <T>(this IKernelConfiguration config, Func <T> method) => config.Bind <T>().ToMethod(c => method());
/// <summary> /// Loads modules from the files that match the specified pattern(s). /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which the files are loaded.</param> /// <param name="filePatterns">The file patterns (i.e. "*.dll", "modules/*.rb") to match.</param> public static void Load(this IKernelConfiguration kernelConfiguration, params string[] filePatterns) { kernelConfiguration.Load(filePatterns); }
/// <summary> /// Loads modules defined in the specified assemblies. /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which the assemblies are loaded.</param> /// <param name="assemblies">The assemblies to search.</param> public static void Load(this IKernelConfiguration kernelConfiguration, params Assembly[] assemblies) { kernelConfiguration.Load(assemblies); }
/// <summary> /// Creates a new instance of the module and loads it into the kernel. /// </summary> /// <typeparam name="TModule">The type of the module.</typeparam> /// <param name="kernelConfiguration">The kernel configuration into which the module is loaded.</param> public static void Load <TModule>(this IKernelConfiguration kernelConfiguration) where TModule : INinjectModule, new() { kernelConfiguration.Load(new TModule()); }
/// <summary> /// Loads the module(s) into the kernel. /// </summary> /// <param name="kernelConfiguration">The kernel configuration.</param> /// <param name="modules">The modules to load into which the modules are loaded.</param> public static void Load(this IKernelConfiguration kernelConfiguration, params INinjectModule[] modules) { kernelConfiguration.Load(modules); }
/// <summary> /// Initializes a new instance of the <see cref="KernelBase"/> class. /// </summary> /// <param name="components">The component container to use.</param> /// <param name="settings">The configuration to use.</param> /// <param name="modules">The modules to load into the kernel.</param> protected KernelBase(IComponentContainer components, INinjectSettings settings, params INinjectModule[] modules) { this.kernelConfiguration = new KernelConfiguration(components, settings, modules); this.kernelConfiguration.Bind<IKernel>().ToMethod(ctx => this); this.kernelConfiguration.Bind<IResolutionRoot>().ToMethod(ctx => this).When(ctx => true); }
public SpecialResolutionContext() { this.kernelConfiguration = new KernelConfiguration(); }
/// <summary> /// Initializes a new instance of the <see cref="ModuleLoader"/> class. /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which modules will be loaded.</param> public ModuleLoader(IKernelConfiguration kernelConfiguration) { KernelConfiguration = kernelConfiguration; }
/// <summary> /// Called when the module is loaded into a kernel. /// </summary> /// <param name="kernelConfiguration">The kernel configuration that is loading the module.</param> public void OnLoad(IKernelConfiguration kernelConfiguration) { this.KernelConfiguration = kernelConfiguration; this.Load(); }
/// <summary> /// Initializes a new instance of the <see cref="CompiledModuleLoaderPlugin"/> class. /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which modules will be loaded.</param> /// <param name="assemblyNameRetriever">The assembly name retriever.</param> public CompiledModuleLoaderPlugin(IKernelConfiguration kernelConfiguration, IAssemblyNameRetriever assemblyNameRetriever) { this.KernelConfiguration = kernelConfiguration; this.assemblyNameRetriever = assemblyNameRetriever; }
public NinjectInstanceResolverFactory(INinjectModule[] veriableModules, INinjectModule[] constantModules) { _veriableModules = veriableModules; _kernelConfiguration = new KernelConfiguration(constantModules); //bunu get instance içine alabilirsin çünkü her seferinde build olamsı gerekiyor. }
public void AbcFeaturesResolveCorrectly(Type featureType, IKernelConfiguration kernelConfiguration, string testName) { TestKernelInitializer.AssertCanBuildFeature(featureType, kernelConfiguration, testName); }
/// <summary> /// Called when the module is loaded into a kernel. /// </summary> /// <param name="kernelConfiguration">The kernel configuration that is loading the module.</param> public void OnLoad(IKernelConfiguration kernelConfiguration) { this.KernelConfiguration = kernelConfiguration; this.Load(); }
public AssemblyBootStep(ISetting <IKernelConfiguration> kernelConfiguration, IAssemblySubSystem assemblySubSystem) { _kernelConfiguration = kernelConfiguration.Value; _assemblySubSystem = assemblySubSystem; }
/// <summary> /// Initializes a new instance of the <see cref="ModuleLoader"/> class. /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which modules will be loaded.</param> public ModuleLoader(IKernelConfiguration kernelConfiguration) { KernelConfiguration = kernelConfiguration; }
/// <summary> /// Loads the module(s) into the kernel. /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which the module is loaded.</param> /// <param name="modules">The modules to load.</param> public static void Load(this IKernelConfiguration kernelConfiguration, params INinjectModule[] modules) { Ensure.ArgumentNotNull(kernelConfiguration, "kernelConfiguration"); kernelConfiguration.Load(modules); }
/// <summary> /// Initializes a new instance of the <see cref="ModuleLoader"/> class. /// </summary> /// <param name="kernelConfiguration">The kernel configuration into which modules will be loaded.</param> /// <exception cref="ArgumentNullException"><paramref name="kernelConfiguration"/> is <see langword="null"/>.</exception> public ModuleLoader(IKernelConfiguration kernelConfiguration) { Ensure.ArgumentNotNull(kernelConfiguration, nameof(kernelConfiguration)); this.kernelConfiguration = kernelConfiguration; }
private IEnumerator ConfigureAsync(IKernelConfiguration configuration) { yield return(StartCoroutine(configuration.Configure())); --_configurationsInProgress; }