本文整理汇总了C#中IWindsorContainer.Install方法的典型用法代码示例。如果您正苦于以下问题:C# IWindsorContainer.Install方法的具体用法?C# IWindsorContainer.Install怎么用?C# IWindsorContainer.Install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWindsorContainer
的用法示例。
在下文中一共展示了IWindsorContainer.Install方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Register
public static void Register(HttpConfiguration configuration)
{
container = new WindsorContainer();
container.Install(FromAssembly.This());
container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel, true));
configuration.Services.Replace(typeof (IHttpControllerActivator), new WindsorCompositionRoot(container));
}
示例2: Register
public void Register(IWindsorContainer container)
{
container.Register(
Component.For<IUserFactory>().ImplementedBy<UserFactory>(),
Component.For<IRavenUniqueInserter>().ImplementedBy<RavenUniqueInserter>(),
Component.For<IRecentReadsQuery>().ImplementedBy<RecentReadsQuery>(),
Component.For<IUserRepository>().ImplementedBy<UserRepository>(),
Component.For<IBookRepository>().ImplementedBy<BookRepository>(),
Component.For<IBookImporter>().ImplementedBy<BookImporter>(),
Component.For<IAuthCookieEncoder>().ImplementedBy<AuthCookieEncoder>()
.Named("AuthCookieEncoder").DependsOn(new {secretKey = AuthCookieSecretKey.Value}),
Component.For<IAuthCookieEncoder>().ImplementedBy<AuthCookieCache>()
.ServiceOverrides(new {encoder = "AuthCookieEncoder"}),
Component.For<ICurrentUserInfoFactory>().ImplementedBy<CurrentUserInfoFactory>(),
Component.For<ICurrentUserInfoProvider>().ImplementedBy<CurrentUserInfoProvider>(),
Component.For<IAuthCookieFactory>().ImplementedBy<AuthCookieFactory>(),
Component.For<IGoogleBooksClient>().ImplementedBy<GoogleBooksClient>()
.DependsOn(new
{
apiKey = "AIzaSyDQsH0G4o3l9FjHUocTO_edha6Pv8N3NXo"
}),
Component.For<IDocumentStore>().UsingFactoryMethod(GetDocumentStore));
container.Install(new WebInstaller());
container.Install(new ApiInstaller());
}
示例3: BootstrapContainer
private static void BootstrapContainer()
{
container = new WindsorContainer();
container.Install(Configuration.FromAppConfig());
container.Install(FromAssembly.This());
var controllerFactory = new WindsorControllerFactory(container);
ControllerBuilder.Current.SetControllerFactory(controllerFactory);
}
示例4: InitializeWindsor
private void InitializeWindsor()
{
_windsorContainer = new WindsorContainer();
_windsorContainer.Install(FromAssembly.Containing<BloghostDependencyInstaller>());
_windsorContainer.Install(FromAssembly.This());
ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory(_windsorContainer.Kernel));
}
示例5: BatchJobService
public BatchJobService()
{
InitializeComponent();
container = new WindsorContainer();
container.Install(Configuration.FromAppConfig());
container.Install(FromAssembly.This());
log = log4net.LogManager.GetLogger("Log.BatchJob");
this.ServiceName = "BatchJobService";
}
示例6: CastleConfig
public static void CastleConfig(IWindsorContainer container)
{
var config = new Config();
config.UseWindsorContructor = true;
container.Install(new SitecoreInstaller(config));
container.Install(new ServiceInstaller());
}
示例7: PrintClient
public PrintClient()
{
container = new WindsorContainer();
container.Install(Castle.Windsor.Installer.Configuration.FromAppConfig());
container.Install(Castle.Windsor.Installer.FromAssembly.This());
IsServerOK = this.OpenHeartBeatToServer();
InitializeComponent();
LoadSubList();
Inti();
}
示例8: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
container = new WindsorContainer();
container.Install(FromAssembly.Containing(typeof(IFileNameChangerService)));
container.Install(FromAssembly.This());
var start = container.Resolve<MainWindow>();
start.ShowDialog();
}
示例9: SetupContainer
private void SetupContainer()
{
_container = new WindsorContainer(new XmlInterpreter("Windsor.config"));
_container.Register(Component.For<IWindsorContainer>().Instance(_container));
_container.Install(new BusInstaller(Keys.CommandServiceEndpoint));
_container.Install(new CommandHandlerInstaller());
_bus = _container.Resolve<IBus>();
}
示例10: BootstrapContainer
private static void BootstrapContainer()
{
container = new WindsorContainer();
container.AddFacility("transactionmanagement", new TransactionFacility());
container.Install(Configuration.FromAppConfig());
container.Install(FromAssembly.Named("com.Sconit.Persistence"));
container.Install(FromAssembly.Named("com.Sconit.Service"));
container.Install(FromAssembly.This());
var controllerFactory = new WindsorControllerFactory(container);
ControllerBuilder.Current.SetControllerFactory(controllerFactory);
}
示例11: Run
public void Run()
{
Container = new WindsorContainer();
Container.AddFacility<TypedFactoryFacility>();
Container.Install(Configuration.FromXmlFile("Config/Windsor.config"));
Container.Install(FromAssembly.This());
Container.Register(Component.For<IServiceLocator>().Instance(new WindsorServiceLocator(Container)));
ServiceLocator.SetLocatorProvider(Container.Resolve<IServiceLocator>);
}
示例12: Application_Startup
private void Application_Startup(object sender, StartupEventArgs e)
{
_container = new WindsorContainer();
_container.AddFacility<TypedFactoryFacility>();
_container.Install(FromAssembly.InThisApplication());
_container.Install(FromAssembly.Named("Filtration.Parser"));
var mainWindow = _container.Resolve<IMainWindow>();
mainWindow.Show();
}
示例13: Boostrapper
public Boostrapper()
{
_container = new WindsorContainer();
_container.AddFacility<LoggingFacility>(facility => facility.UseLog4Net());
_container.Install(new EventstoreInstaller());
_container.Install(new BusInstaller());
Logger = _container.Resolve<ILogger>();
Logger.DebugFormat("Started");
}
示例14: ApplicationContainer
public ApplicationContainer()
{
container = new WindsorContainer();
container.AddFacility<TypedFactoryFacility>();
container.AddFacility<LoggingFacility>(f => f.LogUsing(LoggerImplementation.Log4net).WithConfig("log4net.xml"));
container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel));
container.Register(Component.For<LogInterceptor>());
container.Install(new RepositoryInstaller());
container.Install(new PresentationInstaller());
container.Install(new ApplicationInstaller());
}
示例15: ConfigureApplicationContainer
protected override void ConfigureApplicationContainer(IWindsorContainer existingContainer)
{
base.ConfigureApplicationContainer(existingContainer);
// Add the Array Resolver, so we can take dependencies on T[]
// while only registering T.
existingContainer.Kernel.Resolver.AddSubResolver(new ArrayResolver(existingContainer.Kernel));
// todo use in Selkie project
existingContainer.Install(FromAssembly.Containing(typeof ( Installer )));
existingContainer.Install(FromAssembly.Containing(typeof ( MicroServices.Days.Nancy.Installer )));
existingContainer.Install(FromAssembly.Containing(typeof ( MicroServices.Doctors.Nancy.Installer )));
existingContainer.Install(FromAssembly.Containing(typeof ( MicroServices.DoctorsSlots.Nancy.Installer )));
existingContainer.Install(FromAssembly.Containing(typeof ( MicroServices.Slots.Nancy.Installer )));
}