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


C# ConfigurationExpression.Scan方法代码示例

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


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

示例1: Configure

 protected override void Configure(ConfigurationExpression cfg)
 {
     cfg.Scan(x =>
                  {
                      x.TheCallingAssembly();
                      x.LookForRegistries();
                  });
 }
开发者ID:ChrisAnn,项目名称:Simple.Web,代码行数:8,代码来源:HandlerFactoryBuilderTests.cs

示例2: SetupContainer

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

示例3: Initialize

 private static void Initialize(ConfigurationExpression initializer)
 {
     var tfsPlugin = TfsPlugin.Find();
     initializer.Scan(x => { Initialize(x); tfsPlugin.Initialize(x); });
     initializer.For<TextWriter>().Use(() => Console.Out);
     initializer.For<IGitRepository>().Add<GitRepository>();
     AddGitChangeTypes(initializer);
     DoCustomConfiguration(initializer);
     tfsPlugin.Initialize(initializer);
 }
开发者ID:roend83,项目名称:git-tfs,代码行数:10,代码来源:Program.cs

示例4: SetupContainer

 private static void SetupContainer(ConfigurationExpression x)
 {
     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:KevM,项目名称:fubumvc,代码行数:11,代码来源:Global.asax.cs

示例5: OnConfigure

        private static void OnConfigure(ConfigurationExpression x)
        {
            x.Scan(cfg =>
                       {
                           cfg.TheCallingAssembly();

                           x.For(typeof(IReportingRepository<>)).Use(typeof(InMemoryRepository<>));

                           cfg.WithDefaultConventions();
                       });

            // include the LixRegistry
            x.IncludeRegistry(new LixRegistry());
        }
开发者ID:lukesmith,项目名称:lix,代码行数:14,代码来源:Program.cs

示例6: SetupContainer

        private static void SetupContainer(ConfigurationExpression map)
        {
            map.Scan(x =>
                         {
                             x.TheCallingAssembly();
                             x.WithDefaultConventions();
                             x.LookForRegistries();
                             x.AddAllTypesOf<IPropertyBinder>();
                             x.ConnectImplementationsToTypesClosing(typeof (IValidator<>));

                             PackageRegistry.PackageAssemblies.Each(x.Assembly);
                         });

            map.For<IContinuationDirector>().Use<ContinuationHandler>();
        }
开发者ID:marcusswope,项目名称:Hit-That-Line,代码行数:15,代码来源:FubuMVC.cs

示例7: OnConfigureInMemory

        private static void OnConfigureInMemory(ConfigurationExpression cfg)
        {
            // Configure a single inmemorydatastore to be used
            cfg.For(typeof(InMemoryDataStore)).LifecycleIs(InstanceScope.Hybrid);

            // Configure our IoC container for a inmemoryrepository
            var repositoryInstance = cfg.For(typeof(IReportingRepository<>)).Use(typeof(InMemoryRepository<>));
            cfg.For(typeof(IDomainRepository<>)).Use(repositoryInstance);
            cfg.For(typeof(ILinqEnabledRepository<>)).Use(repositoryInstance);

            cfg.For(typeof(IUnitOfWork)).LifecycleIs(InstanceScope.Hybrid).Use(typeof(InMemoryUnitOfWork));

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

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

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

示例8: Initialize

 private static void Initialize(ConfigurationExpression initializer)
 {
     ConfigureLogger();
     var tfsPlugin = TfsPlugin.Find();
     initializer.Scan(x => { Initialize(x); tfsPlugin.Initialize(x); });
     initializer.For<IGitRepository>().Add<GitRepository>();
     AddGitChangeTypes(initializer);
     DoCustomConfiguration(initializer);
     tfsPlugin.Initialize(initializer);
 }
开发者ID:pmiossec,项目名称:git-tfs,代码行数:10,代码来源:Program.cs

示例9: Scan

 private static void Scan(ConfigurationExpression configExpression)
 {
     configExpression.Scan(ScanAssemblies);
 }
开发者ID:ShankarRamakrishnan,项目名称:CrisisManagement,代码行数:4,代码来源:StructureMapBuilderConfig.cs

示例10: 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


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