本文整理汇总了C#中WindsorContainer.Install方法的典型用法代码示例。如果您正苦于以下问题:C# WindsorContainer.Install方法的具体用法?C# WindsorContainer.Install怎么用?C# WindsorContainer.Install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindsorContainer
的用法示例。
在下文中一共展示了WindsorContainer.Install方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IntegrationContainer
public IntegrationContainer()
{
container = new WindsorContainer();
// allow collection injection
container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel));
// disable automatic property injection
container.Kernel.ComponentModelBuilder.RemoveContributor(
container.Kernel.ComponentModelBuilder.Contributors.OfType<PropertiesDependenciesModelInspector>().Single());
container.Kernel.AddFacility<TypedFactoryFacility>();
//selectively install Finance.Service classes
container.Install( new MappingsCreatorInstaller()
//new MappingsInstaller()
);
//Persistence.EF installers
container.Install(FromAssembly.Containing<ModelContextFactory>());
//Core installers
container.Install(FromAssembly.Containing<AppSettings>());
//Integration inplememntations
container.Register(Component.For<IConnection>().ImplementedBy<IntegrationConnection>());
container.Register(Component.For<IExceptionService>().ImplementedBy<IntegrationExceptionService>());
//Create all mappings
container.Resolve<MappingsCreator>();
DisplayRegistrations();
}
示例2: AddRegistration
protected virtual void AddRegistration(WindsorContainer container)
{
container.Register(Component.For<ISecurityAssertionProvider>().Instance(new SafeMethodOnlySecurityAssertionProvider()));
// Use the version of the interceptor that doesn't allow any calls to go through
// container.Register(Component.For<IInterceptor, ApplyViewPermissionsWithNoProceedInterceptor>());
IoC.Initialize(container);
container.Register(
Component
.For(typeof(IMetricActionUrlAuthorizationProvider))
.Instance(metricActionUrlAuthService));
container.Install(new TestConfigurationSpecificInstaller());
container.Install(new SecurityComponentsInstaller(typeof(ApplyViewPermissionsByClaimWithNoProceedInterceptor)));
container.Install(new MetricServiceInstaller());
container.Install(new GenericServiceInstaller<Marker_EdFi_Dashboards_Warehouse_Resources>());
container.Install(new GenericServiceInstaller<Marker_EdFi_Dashboards_Resources>());
container.Install(new RepositoryInstaller<Marker_EdFi_Dashboards_Data>());
container.Install(new RepositoryInstaller<Marker_EdFi_Dashboards_Metric_Data_Entities>());
container.Install(new PersistedRepositoryInstaller<Marker_EdFi_Dashboards_Application_Data>());
container.Install(new QueryInstaller<Marker_EdFi_Dashboards_Data>());
container.Install(new RepositoryInstaller<Marker_EdFi_Dashboards_Warehouse_Data>());
container.Register(
Classes.FromAssembly(securityAssembly)
.BasedOn<IAuthorizationDelegate>()
.WithService.FirstInterface(),
Component.For<AuthorizationDelegateMap>());
// Register the wrapped service locator singleton instance
container.Register(
Component.For<IServiceLocator>()
.Instance(IoC.WrappedServiceLocator));
}
示例3: PreStart
public static void PreStart()
{
var container = new WindsorContainer();
container.Install(new DataAccessInstaller());
container.Install(new CoreInstaller());
container.Install(new ControllerInstaller());
}
示例4: InitializeWindsor
private void InitializeWindsor()
{
_windsorContainer = new WindsorContainer();
_windsorContainer.Install(FromAssembly.Containing<DependencyInstaller>());
_windsorContainer.Install(FromAssembly.This());
GlobalConfiguration.Configuration.DependencyResolver = new WindsorDependencyResolver(_windsorContainer.Kernel);
}
示例5: Resolve_WithInstaller_ShouldBeNotNull
public void Resolve_WithInstaller_ShouldBeNotNull()
{
var container = new WindsorContainer();
var directory = AppDomain.CurrentDomain.BaseDirectory;
var finder = AssemblyFinder.Builder.UsePath(directory).Create;
container.Kernel.Resolver.AddSubResolver(new ArrayResolver(container.Kernel));
container.Install(new ServiceLocatorInstaller());
var assemblies = finder.GetAssembliesTagged<AssemblyTagAttribute>();
container.Install(new FactoryInstaller(assemblies));
var instance = container.Resolve<IObjectFactory>();
instance.ShouldNotBeNull();
instance.ConfigurationProvider.Configuration.Items.ShouldNotBeEmpty();
instance.ConfigurationProvider.Configuration.Items.Count.ShouldBe(1);
instance.ConfigurationProvider.Sources.ShouldNotBeEmpty();
instance.ConfigurationProvider.Sources.Length.ShouldBe(2);
instance.ShouldBeAssignableTo<IObjectFactory>();
instance.ShouldBeOfType<ObjectFactory>();
}
示例6: CreateContainer
static IWindsorContainer CreateContainer()
{
IWindsorContainer container = new WindsorContainer();
container.Install(FromAssembly.InThisApplication());
container.Install(new DefaultHandlerInstaller());
return container;
}
示例7: Main
internal static void Main()
{
IWindsorContainer container = new WindsorContainer();
container.Install(FromAssembly.InDirectory(new AssemblyFilter("Commands")));
container.Install(FromAssembly.This());
var interpretor = container.Resolve<CommandInterpreter>();
interpretor.Run();
}
示例8: button1_Click
private void button1_Click(object sender, EventArgs e)
{
IWindsorContainer container = new WindsorContainer();
container.Install(Configuration.FromAppConfig());
container.Install(FromAssembly.Named("com.Sconit.BatchJob.WindowsService"));
IJobRunMgr jobRunMgr = container.Resolve<IJobRunMgr>();
jobRunMgr.RunBatchJobs(container);
container.Dispose();
}
示例9: Start
public void Start()
{
_windsorContainer = new WindsorContainer();
_windsorContainer.Install(FromAssembly.Containing<PhoneBookDependencyInstaller>());
_windsorContainer.Install(FromAssembly.This());
_windsorContainer.Resolve<IPeriodicServiceTrigger>().Start();
}
示例10: Startable_and_components_in_separate_Install_Startable_last_works
public void Startable_and_components_in_separate_Install_Startable_last_works()
{
using (var container = new WindsorContainer())
{
container.AddFacility<StartableFacility>(f => f.DeferredStart());
container.Install(new DependenciesInstaller());
container.Install(new StartableInstaller());
}
}
示例11: CreateContainer
private IWindsorContainer CreateContainer()
{
var container = new WindsorContainer();
container.Install(new PersistenceInstaller());
container.Install(new ServicesInstaller());
container.Install(new ControllersInstaller());
container.Install(new HubsInstaller());
return container;
}
示例12: Initialize
public void Initialize(string filename)
{
using (var container = new WindsorContainer())
{
container.Install(FromAssembly.Containing<DapperInstaller>());
container.Install(FromAssembly.Containing<ServicesInstaller>());
var importService = container.Resolve<ITransactionImportService>();
importService.Import(filename);
}
}
示例13: Application_Start
protected void Application_Start()
{
var container = new WindsorContainer();
container.Install(new WebInstaller());
container.Install(new BusInstaller());
ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container));
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
示例14: InitializeWindsor
private void InitializeWindsor()
{
_windsorContainer = new WindsorContainer();
_windsorContainer.Install(FromAssembly.Containing<DependencyInstaller>());
_windsorContainer.Install(FromAssembly.This());
ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory(_windsorContainer.Kernel));
//register web api dependency resolver
GlobalConfiguration.Configuration.DependencyResolver = new WindsorDependencyResolver(_windsorContainer.Kernel);
//filter
System.Web.HttpContext.Current.Application["Windsor"] = _windsorContainer;
}
示例15: Bootstrap
public static IWindsorContainer Bootstrap()
{
XmlConfigurator.Configure();
var container = new WindsorContainer();
container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel, true));
container.Install(new ControllerRegistry());
container.Install(new BuildScreenRegistry());
var controllerFactory = new WindsorControllerFactory(container.Kernel);
ControllerBuilder.Current.SetControllerFactory(controllerFactory);
return container;
}