当前位置: 首页>>代码示例>>C#>>正文


C# IConfigurationStore类代码示例

本文整理汇总了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());
        }
开发者ID:Firyuza,项目名称:University,代码行数:34,代码来源:Installer.cs

示例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"));
        }
开发者ID:RadoBuransky,项目名称:CanteenBoard,代码行数:30,代码来源:CommonInstaller.cs

示例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());
 }
开发者ID:seif,项目名称:Sharp-Architecture-Template-RavenDB,代码行数:7,代码来源:QueryInstaller.cs

示例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>())));
 }
开发者ID:AdamCollings,项目名称:dbqf,代码行数:7,代码来源:InitialiserInstaller.cs

示例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
                );
        }
开发者ID:AnnaKerina,项目名称:TrainingProject,代码行数:26,代码来源:PersistenceInstaller.cs

示例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");
     }
 }
开发者ID:HighwayFramework,项目名称:Highway.Onramp.MVC,代码行数:25,代码来源:EntityFrameworkInstaller.cs

示例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);
        }
开发者ID:bogdanbl,项目名称:OntoWebStore,代码行数:27,代码来源:ControllersInstaller.cs

示例8: Install

 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         // Most components
         Classes.FromThisAssembly().Pick().WithServiceFirstInterface().LifestyleTransient()
     );
 }
开发者ID:rustyrazorblade,项目名称:killrvideo-csharp,代码行数:7,代码来源:SampleDataServiceWindsorInstaller.cs

示例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());
 }
开发者ID:Jedzia,项目名称:BackBock,代码行数:29,代码来源:ServiceInstaller.cs

示例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
         );
 }
开发者ID:romartinez,项目名称:sicemed,代码行数:28,代码来源:DependenciesInstaller.cs

示例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());
        }
开发者ID:marufbd,项目名称:Zephyr.NET,代码行数:33,代码来源:PersistenceInstaller.cs

示例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;
        }
开发者ID:techvenky,项目名称:mybatisnet,代码行数:30,代码来源:ProcessParameterMapElement.cs

示例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);
 }
开发者ID:foob,项目名称:TimeTracker,代码行数:7,代码来源:ContainerInstaller.cs

示例14: Install

 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         Component.For(typeof(IFigureRenderer<PolygonFigure>))
         .ImplementedBy(typeof(PolygonRenderer))
         .LifestyleTransient());
 }
开发者ID:Alano13,项目名称:Scene,代码行数:7,代码来源:FigureInstaller.cs

示例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())
         );
 }
开发者ID:Grievoushead,项目名称:WebHRM,代码行数:7,代码来源:NHibernateInstaller.cs


注:本文中的IConfigurationStore类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。