本文整理汇总了C#中IConfigurationStore类的典型用法代码示例。如果您正苦于以下问题:C# IConfigurationStore类的具体用法?C# IConfigurationStore怎么用?C# IConfigurationStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IConfigurationStore类属于命名空间,在下文中一共展示了IConfigurationStore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(Component.For<IStudentService>()
.ImplementedBy<StudentService>()
.LifestyleTransient());
container.Register(Component.For<IGroupService>()
.ImplementedBy<GroupService>()
.LifestyleTransient());
container.Register(Component.For<IDepartmentService>()
.ImplementedBy<DepartmentService>()
.LifestyleTransient());
container.Register(Component.For<IPositionService>()
.ImplementedBy<PositionService>()
.LifestyleTransient());
container.Register(Component.For<ITeacherService>()
.ImplementedBy<TeacherService>()
.LifestyleTransient());
container.Register(Component.For<ICourseService>()
.ImplementedBy<CourseService>()
.LifestyleTransient());
container.Register(Component.For<IScheduleService>()
.ImplementedBy<ScheduleService>()
.LifestyleTransient());
container.Register(Component.For<IAcademicProgressService>()
.ImplementedBy<AcademicProgressService>()
.LifestyleTransient());
}
示例2: Install
/// <summary>
/// Performs the installation in the <see cref="T:Castle.Windsor.IWindsorContainer" />.
/// </summary>
/// <param name="container">The container.</param>
/// <param name="store">The configuration store.</param>
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.AddFacility<LoggingFacility>(f => f.UseLog4Net());
container.Register(
Component.For<IRepository>()
.ImplementedBy<GenericRepository>()
.DependsOn(
Dependency.OnValue("connectionString", ConfigurationManager.ConnectionStrings["MongoDB"].ConnectionString),
Dependency.OnAppSettingsValue("databaseName", "DbName")),
Component.For<IFoodProcessor>()
.ImplementedBy<FoodProcessor>(),
Component.For<IBoardProcessor>()
.ImplementedBy<BoardProcessor>()
.DynamicParameters((DynamicParametersDelegate)GetBoardTemplates),
Component.For<BoardTemplate>()
.ImplementedBy<DailyMenuBoardTemplate>()
.Named("DailyMenuBoardTemplate"),
Component.For<BoardTemplate>()
.ImplementedBy<SalatsBoardTemplate>()
.Named("SalatsBoardTemplate"));
}
示例3: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
AllTypes.FromAssemblyNamed("SharpArchTemplate.Web.Mvc")
.InNamespace("SharpArchTemplate.Web.Mvc.Controllers.Queries", true)
.WithService.DefaultInterfaces());
}
示例4: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
Classes.FromThisAssembly().BasedOn<IInitialiser>().WithService.FromInterface(),
Component.For<IList<IInitialiser>>().UsingFactoryMethod<List<IInitialiser>>(
c => new List<IInitialiser>(c.ResolveAll<IInitialiser>())));
}
示例5: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(Component
.For<IDatabaseContext>()
.ImplementedBy<DatabaseContext>()
.DependsOn(Dependency.OnValue("nameOrConnectionString", "DefaultConnection"))
.LifeStyle.Transient
);
container.Register(Component
.For<IUserStore>()
.ImplementedBy<UserStore>()
.LifeStyle.Transient);
container.Register(Component
.For<IPostStore>()
.ImplementedBy<PostStore>()
.LifeStyle.Transient
);
container.Register(Component
.For<IUnitOfWork>()
.ImplementedBy<UnitOfWork>()
.LifeStyle.Transient
);
}
示例6: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
var config = container.Resolve<IDatabaseInitializerConfig>();
switch (config.Initializer)
{
case Configs.InitializerTypes.DropCreateDatabaseAlways:
container.Register(Component.For<IDatabaseInitializer<DomainContext<Domain>>>()
.ImplementedBy<DropCreateDatabaseAlways<DomainContext<Domain>>>().LifestyleSingleton());
break;
case Configs.InitializerTypes.DropCreateDatabaseIfModelChanges:
container.Register(Component.For<IDatabaseInitializer<DomainContext<Domain>>>()
.ImplementedBy<DropCreateDatabaseIfModelChanges<DomainContext<Domain>>>().LifestyleSingleton());
break;
case Configs.InitializerTypes.CreateDatabaseIfNotExists:
container.Register(Component.For<IDatabaseInitializer<DomainContext<Domain>>>()
.ImplementedBy<CreateDatabaseIfNotExists<DomainContext<Domain>>>().LifestyleSingleton());
break;
case Configs.InitializerTypes.NullDatabaseInitializer:
container.Register(Component.For<IDatabaseInitializer<DomainContext<Domain>>>()
.ImplementedBy<NullDatabaseInitializer<DomainContext<Domain>>>().LifestyleSingleton());
break;
default:
throw new NotImplementedException("Unknown Enumeration Value");
}
}
示例7: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(Classes.FromThisAssembly()
.BasedOn<IController>()
.LifestyleTransient());
container.Register(Component
.For<IControllerFactory>()
.UsingFactoryMethod(_ => new WindsorControllerFactory(container))
.LifeStyle.Singleton);
container.Register(Component.For<IRdfTranslator>()
.UsingFactoryMethod(_ => new RdfTranslator(container.Resolve<IMongoDataContextProvider>()))
.LifeStyle.PerWebRequest);
container.Register(Component.For<IMongoDataContextProvider>()
.UsingFactoryMethod(_ => new MongoDataContextProvider())
.LifeStyle.PerWebRequest);
//container.Register(Component.For<IFormsAuthenticationService>()
// .UsingFactoryMethod(_ => new FormsAuthenticationService())
// .LifeStyle.PerWebRequest);
//container.Register(Component.For<IMembershipService>()
// .UsingFactoryMethod(_ => new AccountMembershipService())
// .LifeStyle.PerWebRequest);
}
示例8: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
// Most components
Classes.FromThisAssembly().Pick().WithServiceFirstInterface().LifestyleTransient()
);
}
示例9: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
if (ViewModelBase.IsInDesignModeStatic)
{
// SimpleIoc.Default.Register<IDataService, Design.DesignDataService>();
container.Register(Component.For<IDataProvider>().ImplementedBy<DesignDataProvider>());
}
else
{
// SimpleIoc.Default.Register<IDataService, DataService>();
container.Register(Component.For<IDataProvider>().ImplementedBy<DataProvider>());
}
//container.Register(Component.For<Window1>());
//container.Register(Component.For<Window>().ImplementedBy<Window1>().LifeStyle.Transient);
container.Register(Component.For<IWindow>().ImplementedBy<Window1>());
container.Register(Component.For<IDepp>().ImplementedBy<OlderDepp>());
//container.Register(Component.For<MainViewModel>()
// .ServiceOverrides(new { handler = "handler" }));
container.Register(Component.For<MainViewModel>());
//container.Register(Component.For<MainWindowAdapter>());
//container.Register(Component.For<IWindow>().ImplementedBy<SubWindow>());
//container.Register(AllTypes.FromThisAssembly().BasedOn<ViewModelBase>());
//container.Register(AllTypes.FromThisAssembly().Pick()
// .If(Component.IsInSameNamespaceAs<FileIOService>()));
//container.Register(AllTypes.FromThisAssembly().Pick()
// .If(Component.IsInSameNamespaceAs<FormsAuthenticationService>())
// .LifestyleTransient()
// .WithService.DefaultInterfaces());
}
示例10: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
//Application Services
container.Register(
//Singletons
Component.For<IFormAuthenticationStoreService>().ImplementedBy<FormAuthenticationStoreService>().
LifeStyle.Singleton,
Component.For<ICryptoEngine>().Instance(new RijndaelEngine("S3CR3t0.3spC14L")).LifeStyle.Singleton,
Component.For<IMembershipMailer>().ImplementedBy<MembershipMailer>().LifeStyle.Transient,
Component.For<INotificationService>().ImplementedBy<NotificationService>().LifeStyle.Transient,
Component.For<ISecurityService>().ImplementedBy<SecurityService>().LifeStyle.Singleton,
//Providers
Component.For<ICacheProvider>().ImplementedBy<InMemoryCacheProvider>().LifeStyle.Singleton,
Component.For<IMappingEngine>().UsingFactoryMethod(() => Mapper.Engine).LifeStyle.Singleton,
//Menu Provider
//Queries
AllTypes.FromThisAssembly().BasedOn<IQuery>()
.WithService.DefaultInterface().Configure(x => x.LifeStyle.Transient),
Component.For<IQueryFactory>().AsFactory(),
//Report
AllTypes.FromThisAssembly().BasedOn<IReport>()
.WithService.DefaultInterface().Configure(x => x.LifeStyle.Transient),
Component.For<IReportFactory>().AsFactory(),
Component.For<IApplicationInstaller>().ImplementedBy<ApplicationInstaller>().LifeStyle.Singleton,
//Transients
Component.For<IMembershipService>().ImplementedBy<MembershipService>().LifeStyle.Transient
);
}
示例11: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
var windsorContainer = container;
//NHibernate Configuration
windsorContainer.Register(
Component.For<NHibernate.Cfg.Configuration>().UsingFactoryMethod(
_ => NHibernateSession.Configure(null, windsorContainer.Resolve<ZephyrConfiguration>())).LifestyleSingleton());
//Nhibernate session factory
windsorContainer.Register(
Component.For<ISessionFactory>().UsingFactoryMethod(
k => k.Resolve<NHibernate.Cfg.Configuration>().BuildSessionFactory()).LifestyleSingleton());
if (ZephyrContext.IsWebApplication)
{
windsorContainer.Register(
Component.For<ISession>().UsingFactoryMethod(k => k.Resolve<ISessionFactory>().OpenSession())
.LifestylePerWebRequest());
}
else
{
windsorContainer.Register(
Component.For<ISession>().UsingFactoryMethod(k => k.Resolve<ISessionFactory>().OpenSession())
.LifestyleTransient());
}
windsorContainer.Register(
Component.For<IUnitOfWorkFactory>().ImplementedBy<NhUnitOfWorkFactory>().LifestyleTransient());
}
示例12: ProcessParameterMapElement
/// <summary>
/// Processes a parameter map element.
/// </summary>
/// <param name="element">The element.</param>
/// <param name="configurationStore">The configuration store.</param>
private void ProcessParameterMapElement(Tag element, IConfigurationStore configurationStore)
{
MutableConfiguration config = null;
if (element.Attributes.ContainsKey(ConfigConstants.ATTRIBUTE_CLASS))
{
config = new MutableConfiguration(
element.Name,
ApplyNamespace(element.Attributes[ConfigConstants.ATTRIBUTE_ID]),
element.Attributes[ConfigConstants.ATTRIBUTE_CLASS]);
}
else
{
config = new MutableConfiguration(
element.Name,
ApplyNamespace(element.Attributes[ConfigConstants.ATTRIBUTE_ID]));
}
config.CreateAttributes(element.Attributes);
config.CreateAttribute(ConfigConstants.ATTRIBUTE_NAMESPACE, nameSpace);
AddAttribute(config, ConfigConstants.ATTRIBUTE_EXTENDS, true);
configurationStore.AddParameterMapConfiguration(config);
element.Configuration = config;
}
示例13: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(Component.For<TimeTrackerContext>());
container.Register(Component.For<IService<Project>>().ImplementedBy<ProjectService>().LifeStyle.Transient);
container.Register(Component.For<IService<Booking>>().ImplementedBy<BookingService>().LifeStyle.Transient);
container.Register(Component.For<IService<User>>().ImplementedBy<UserService>().LifeStyle.Transient);
}
示例14: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
Component.For(typeof(IFigureRenderer<PolygonFigure>))
.ImplementedBy(typeof(PolygonRenderer))
.LifestyleTransient());
}
示例15: Install
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
//Component.For<ISessionFactory>().LifeStyle.Singleton.Instance(PersistenceManager.Factory),
Component.For<ISession>().LifeStyle.PerWebRequest.UsingFactoryMethod(x => x.Resolve<ISessionFactory>().OpenSession())
);
}