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


C# ConfigurationExpression.AddRegistry方法代码示例

本文整理汇总了C#中ConfigurationExpression.AddRegistry方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigurationExpression.AddRegistry方法的具体用法?C# ConfigurationExpression.AddRegistry怎么用?C# ConfigurationExpression.AddRegistry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigurationExpression的用法示例。


在下文中一共展示了ConfigurationExpression.AddRegistry方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Configure

        public void Configure(ConfigurationExpression cfg, IFoundationConfigurator foundationConfigurator)
        {

            if (foundationConfigurator.UseQueryContainer)
            {
                cfg.AddRegistry(new QueryRegistery());
                cfg.For<IQueryRegistery>().Use<QueryRegistery>();
            }

            if (foundationConfigurator.UseBuseinssManagers)
            {
                cfg.AddRegistry(new BusinessManagerRegistery());
                cfg.For<IBusinessManagerRegistery>().Use<BusinessManagerRegistery>();
                cfg.For<IBusinessManagerInvocationLogger>(foundationConfigurator.Business.BusinessInvocationLogger, true);
            }

            if (foundationConfigurator.UseEmailing)
            {
                cfg.AddRegistry(new EmailRegistery());
                cfg.For<IEmailLogger>(foundationConfigurator.Business.EmailLogger);
            }

            if (foundationConfigurator.Web.FlashMessenger != null)
            {
                cfg.For<IFlashMessenger>(foundationConfigurator.Web.FlashMessenger);
            }

            cfg.AddRegistry(new SecurityRegistery());
        }
开发者ID:AbdoNile,项目名称:Foundation.Old,代码行数:29,代码来源:InfrastructureConfigurator.cs

示例2: Configure

 public void Configure(ConfigurationExpression cfg, IFoundationConfigurator foundationConfigurator)
 {
     if (foundationConfigurator.UsePresistence)
     {
         cfg.AddRegistry(new PersistenceRegistery());
         cfg.For<IConnectionString>()
            .Use(new ConnectionString(foundationConfigurator.Persistence.ConnectionStringKeyName));
     }
 }
开发者ID:AbdoNile,项目名称:Foundation,代码行数:9,代码来源:PersistenceConfigurator.cs

示例3: Configure

        static void Configure(ConfigurationExpression x)
        {
            x.AddRegistry(new MyAppRegistry());

            x.For<IObjectContainer>()
                .Singleton()
                .Use(Db4oEmbedded.OpenFile(Db4oEmbedded.NewConfiguration(), DbPath));

            x.For(typeof (IRepository<>))
                .Use(typeof (Repository<>));
        }
开发者ID:RookieOne,项目名称:GPA-Houston,代码行数:11,代码来源:Bootstrapper.cs

示例4: ConfigureDependencies

        private static void ConfigureDependencies(ConfigurationExpression cfg)
        {
            cfg.AddRegistry(new PersistenceRegistery());

            cfg.AddRegistry(new WebRegistery());

            cfg.AddRegistry(new QueryRegistery());

            cfg.AddRegistry(new BusinessManagerRegistery());

            cfg.For<IQueryRegistery>().Use<QueryRegistery>();

            cfg.For<IBusinessManagerRegistery>().Use<BusinessManagerRegistery>();
            
            cfg.For<IBusinessManagerInvocationLogger>().Singleton().Use<SqlProcBusinessManagerInvocationLogger>();

            cfg.For<ITypeHolder>().Use<TypeHolder>();

            cfg.For<IConnectionString>().Use(new ConnectionString("KafalaDB"));
        }
开发者ID:AbdoNile,项目名称:Foundation,代码行数:20,代码来源:Global.asax.cs

示例5: SetupContainer

 private static void SetupContainer(ConfigurationExpression x)
 {
     x.AddRegistry<AppSettingProviderRegistry>();
     x.For<IHttpSession>().Use<CurrentHttpContextSession>();
     x.Scan(i =>
     {
         i.TheCallingAssembly();
         i.Convention<SettingsScanner>();
     });
     x.For<ISettingsProvider>().Use<AppSettingsProvider>();
     x.SetAllProperties(s => s.Matching(p => p.Name.EndsWith("Settings")));
 }
开发者ID:sharpoverride,项目名称:fubumvc,代码行数:12,代码来源:Global.asax.cs

示例6: ConfigureDependencies

        public static void ConfigureDependencies(ConfigurationExpression cfg)
        {
            cfg.AddRegistry(new PersistenceRegistery());

            cfg.AddRegistry(new QueryRegistery());

            cfg.AddRegistry(new BusinessManagerRegistery());

            cfg.For<IQueryRegistery>().Use<QueryRegistery>();

            cfg.For<IBusinessManagerRegistery>().Use<BusinessManagerRegistery>();

            cfg.For<IBusinessManagerInvocationLogger>().Singleton().Use<SqlProcBusinessManagerInvocationLogger>();

            cfg.For<IConnectionString>().Use(new ConnectionString("KafalaDBTest"));

            cfg.For<IEmailMessageSender>().Use<SwllowEmailService>();

            cfg.For<IAuthenticationService>().Use<AuthenticationService>();

            cfg.For<IPasswordHelper>().Use<PasswordHelper>();

        }
开发者ID:AbdoNile,项目名称:Foundation,代码行数:23,代码来源:Configurations.cs

示例7: Configure

        public void Configure(ConfigurationExpression cfg, IFoundationConfigurator foundationConfigurator)
        {
            if (foundationConfigurator.UseWeb)
            {
                cfg.AddRegistry(new WebRegistery(foundationConfigurator));
                cfg.For<IResourcesLocator>().Use(foundationConfigurator.Web);

                // this.RegisterPagingAndSortingModelBinders(foundationConfigurator.Web.ViewModelsAssemblyHookType);

                ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory(ObjectFactory.Container));
                DependencyResolver.SetResolver(new StructureMapDependencyResolver(ObjectFactory.Container));

                if (foundationConfigurator.Web.PagingConfigurations != null)
                {
                    WebConfigurations.PagingConfigurations =
                        foundationConfigurator.Web.PagingConfigurations;
                }
            }
        }
开发者ID:AbdoNile,项目名称:Foundation,代码行数:19,代码来源:WebConfigurator.cs

示例8: OnConfigureNHibernate

        private static void OnConfigureNHibernate(ConfigurationExpression cfg)
        {
            HibernatingRhinos.NHibernate.Profiler.Appender.NHibernateProfiler.Initialize();

            var configuration = Fluently.Configure()
                .Mappings(x => x.AutoMappings.Add(AutoMap.AssemblyOf<Person>().Where(t => typeof(Person).IsAssignableFrom(t))))
                .Database(SQLiteConfiguration.Standard.InMemory().ShowSql());
            var sessionFactory = configuration.BuildSessionFactory();

            // Configure nhibernate
            cfg.For<ISessionFactory>().Singleton().Use(sessionFactory);
            cfg.For<ISession>().Singleton().Use(x =>
                                                    {
                                                        var session = x.GetInstance<ISessionFactory>().OpenSession();
                                                        session.FlushMode = FlushMode.Commit;

                                                        using (var tx =session.BeginTransaction())
                                                        {
                                                            new SchemaExport(configuration.BuildConfiguration()).Execute(true, true, false, session.Connection, null);
                                                            tx.Commit();
                                                        }

                                                        return session;
                                                    });

            // Configure our IoC container for a nhibernaterepository
            cfg.AddRegistry(new LixNHibernateRegistry());

            // include the LixRegistry
            cfg.AddRegistry(new LixRegistry());

            cfg.Scan(s =>
                         {
                             s.TheCallingAssembly();

                             s.WithDefaultConventions();
                         });
        }
开发者ID:lukesmith,项目名称:lix,代码行数:38,代码来源:Program.cs

示例9: Configure

 private static void Configure(ConfigurationExpression x)
 {
     x.AddRegistry<CoinSorterRegistry>();
     x.AddRegistry<CoinIdentifierRegistry>();
     x.AddRegistry<CoinCheckRegistry>();
 }
开发者ID:bnathyuw,项目名称:Chain-of-Resposibility,代码行数:6,代码来源:DependencyResolver.cs

示例10: Configure

 private static void Configure(ConfigurationExpression x)
 {
     x.AddRegistry<SharlotkaRegistry>();
 }
开发者ID:bnathyuw,项目名称:Sharlotka-State-Pattern,代码行数:4,代码来源:DependencyResolver.cs

示例11: InitializeContainer

 protected override void InitializeContainer(ConfigurationExpression configuration)
 {
     configuration.AddRegistry<WebRegistry>();
 }
开发者ID:tim-cools,项目名称:RealTimeWeb.NET,代码行数:4,代码来源:WebIntegrationTestFixture.cs


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