/// <summary> /// Configures the console outputs. /// </summary> /// <param name="dependencyInjectionContainer">The dependency injection container.</param> public static void ConfigureConsoleOutputs(this IDependencyInjectionContainer dependencyInjectionContainer) { dependencyInjectionContainer.Register <IConsoleOutput, ConsoleOutput>(); dependencyInjectionContainer.Register <IScriptingStatusInterpretationStrategyFactory, ScriptingStatusInterpretationStrategyFactory>(); dependencyInjectionContainer.Register <IScriptingStatusObserver, ConsoleOutputScriptingStatusObserver>("a"); dependencyInjectionContainer.Register <IFileDiscoveryStatusInterpretationStrategyFactory, FileDiscoveryStatusInterpretationStrategyFactory>(); dependencyInjectionContainer.Register <IFileDiscoveryStatusObserver, ConsoleOutputFileDiscoveryStatusObserver>("a"); }
public override void Prepare() { container = new DependencyInjectionContainer(); // Register all needed types out of StyleMVVM.DotNet container.RegisterAssembly(typeof(DependencyInjectionContainer).Assembly); // Remove extra XAML based exports that aren't need (MVVM classes and what not) container.RemoveXAMLExports(); // Register local exports container.Register<Singleton>().As<ISingleton>().AndSharedPermenantly(); container.Register<Transient>().As<ITransient>(); container.Register<Combined>().As<ICombined>().ImportConstructor(() => new Combined(null, null)); container.Start(); }
static DI() { _current.Register <IUnitOfWork, ICommandContextProvider, IEventSourceMapper>((commandContextProvider, eventSourceMapper) => new UnitOfWork(commandContextProvider, eventSourceMapper)); _current.Register <IEventSourceMapper, IEventSourceFactory, IEventStore, IEventConversionRunner>((eventSourceFactory, eventStoreAdapter, eventConverterFactory) => new EventSourceMapper(eventSourceFactory, eventStoreAdapter)); _current.Register <IEventSourceFactory>(() => new EventSourceFactory()); _current.Register <IEventFactory>(() => new EventFactory()); _current.Register <IEventHandlerFactory>(() => new EventHandlerFactory()); _current.Register <IEventConversionRunner, IEventConverterFactory>(eventConverterFactory => new EventConversionRunner(eventConverterFactory)); _current.Register <IEventConverterFactory>(() => new EventConverterFactory()); }
public static void RegisterExport(IDependencyInjectionContainer container) { container.Register <DebugLogAppender>().As <ILogAppender>(); }
/// <summary> /// Configures the scripting tool. /// </summary> /// <param name="dependencyInjectionContainer">The dependency injection container.</param> public static void ConfigureScriptingTool(this IDependencyInjectionContainer dependencyInjectionContainer) { dependencyInjectionContainer.Register <IFileDiscoveryService, FileDiscoveryService>((dic) => new FileDiscoveryService("*.csx", dic.ResolveAll <IFileDiscoveryStatusObserver>().ToArray())); dependencyInjectionContainer.Register <IScriptLoaderService, ScriptLoaderService>(); dependencyInjectionContainer.Register <IScriptingService, ScriptingService>(); }