• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ConfigurationExpression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ConfigureHttpInterfaces

 private void ConfigureHttpInterfaces(ConfigurationExpression x)
 {
     // Woot!!  Interfaces for HttpContext stuff!  Goodbye to nasty unmockable
     // abstract base classes.
     // http://haacked.com/archive/2007/09/09/ihttpcontext-and-other-interfaces-for-your-duck-typing-benefit.aspx
     // Update: the third party library in that post causes problems in production if multiple
     // requests during the bootstrapping process.  I made hand-rolled proxies instead, which you can get here:
     // http://github.com/jonkruger/httpinterfaces
     x.For<IHttpApplication>().Use(
         c => WebContext.Cast(HttpContext.Current.ApplicationInstance));
     x.For<IHttpApplicationState>().Use(
         c => WebContext.Cast(HttpContext.Current.Application));
     x.For<IHttpCachePolicy>().Use(
         c => WebContext.Cast(HttpContext.Current.Response.Cache));
     x.For<IHttpClientCertificate>().Use(
         c => WebContext.Cast(HttpContext.Current.Request.ClientCertificate));
     x.For<IHttpContext>().Use(
         c => WebContext.Cast(HttpContext.Current));
     x.For<IHttpFileCollection>().Use(
         c => WebContext.Cast(HttpContext.Current.Request.Files));
     x.For<IHttpModuleCollection>().Use(
         c => WebContext.Cast(HttpContext.Current.ApplicationInstance.Modules));
     x.For<IHttpRequest>().Use(
         c => WebContext.Cast(HttpContext.Current.Request));
     x.For<IHttpResponse>().Use(
         c => WebContext.Cast(HttpContext.Current.Response));
     x.For<IHttpServerUtility>().Use(
         c => WebContext.Cast(HttpContext.Current.Server));
     x.For<IHttpSession>().Use(
         c => WebContext.Cast(HttpContext.Current.Session));
     x.For<ITraceContext>().Use(
         c => WebContext.Cast(HttpContext.Current.Trace));
 }
开发者ID:JonKruger,项目名称:MvcStarterProject,代码行数:33,代码来源:StructureMapConfiguration.cs


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


示例3: InitializeActivityLogging

		protected virtual void InitializeActivityLogging(ConfigurationExpression x)
		{
			x.For<IActivityLogPathProvider>().HybridHttpOrThreadLocalScoped().Use<ActivityLogPathProvider>();
			x.For<ILogManager>().HybridHttpOrThreadLocalScoped().Use<TpLogManager>();
			x.For<Log4NetFileRepositoryMock>().Singleton().Use<Log4NetFileRepositoryMock>();
			x.Forward<Log4NetFileRepositoryMock, ILog4NetFileRepository>();
		}
开发者ID:chenhualei,项目名称:Target-Process-Plugins,代码行数:7,代码来源:ActivityLoggingContext.cs


示例4: ConfigureContainer

        private static void ConfigureContainer(ConfigurationExpression container)
        {
            //Swap out the default ContentRenderer for our custom
            container.For<IContentRenderer>().Use<ErrorHandlingContentRenderer>();

            //Implementations for custom interfaces can be registered here.
        }
开发者ID:valdisiljuconoks,项目名称:EPiBootstrapArea,代码行数:7,代码来源:DependencyResolverInitialization.cs


示例5: AddGitChangeTypes

 public static void AddGitChangeTypes(ConfigurationExpression initializer)
 {
     initializer.For<IGitChangedFile>().Use<Add>().Named("A");
     initializer.For<IGitChangedFile>().Use<Modify>().Named("M");
     initializer.For<IGitChangedFile>().Use<Delete>().Named("D");
     initializer.For<IGitChangedFile>().Use<RenameEdit>().Named("R");
 }
开发者ID:hammerdr,项目名称:git-tfs,代码行数:7,代码来源:Program.cs


示例6: SetDefaultClickatellClient

 private static void SetDefaultClickatellClient(ClickatellConfigFileSettings clickatellConfigFileSettings,
     ConfigurationExpression x)
 {
     var clickatellClient = new ClickatellClient(clickatellConfigFileSettings);
     x.For<ClickatellClient>()
         .Use(new IgnoreAuthErrorClickatellClient(clickatellConfigFileSettings,
             new IgnoreNoCreditErrorClickatellClient(clickatellConfigFileSettings, clickatellClient)));
 }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:8,代码来源:ClickatellDatabaseTests.cs


示例7: Configure

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


示例8: For

        public static IPipelineGraph For(Action<ConfigurationExpression> action)
        {
            var expression = new ConfigurationExpression();
            action(expression);

            var graph = expression.BuildGraph();

            return BuildRoot(graph);
        }
开发者ID:structuremap,项目名称:structuremap,代码行数:9,代码来源:PipelineGraph.cs


示例9: SecurityContext

        private SecurityContext(ConfigurationExpression configurationExpression)
        {
            _data = new ExpandoObject();
            _isAuthenticated = configurationExpression.IsAuthenticated;
            _roles = configurationExpression.Roles;

            var modifyer = configurationExpression.Advanced.SecurityContextModifyer;
            if (modifyer != null) modifyer.Invoke(this);
        }
开发者ID:Ridermansb,项目名称:FluentSecurity,代码行数:9,代码来源:SecurityContext.cs


示例10: For

        public static RootPipelineGraph For(Action<ConfigurationExpression> action)
        {
            var expression = new ConfigurationExpression();
            action(expression);

            PluginGraph graph = expression.BuildGraph();

            return new RootPipelineGraph(graph);
        }
开发者ID:rossipedia,项目名称:structuremap,代码行数:9,代码来源:RootPipelineGraph.cs


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


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


示例13: ConfigureContainer

 private static void ConfigureContainer(ConfigurationExpression container)
 {
     //Swap out the default ContentRenderer for our custom
     //container.For<IContentRenderer>().Use<ErrorHandlingContentRenderer>();
     container.For<ContentAreaRenderer>().Use<ContentAreaWithDefaultsRenderer>();
     container.For<ICustomerAddressRepository>().Use<CustomerAddressRepository>();
     container.For<IOrderRepository>().Use<OrderRepository>();
     container.For<IExportOrderService>().Use<ExportOrderService>();
 }
开发者ID:smchristenson,项目名称:CommerceStarterKit,代码行数:9,代码来源:DependencyResolverInitialization.cs


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


示例15: ConfigureContainer

        private static void ConfigureContainer(ConfigurationExpression container)
        {
            container.For<IFormSerializer>().Use<FormSerializer>();
            container.For<IFormFieldSerializeUtils>().Use<FormFieldSerializeUtils>();
            container.For<IFormFieldModelBuilder>().Use<FormFieldModelBuilder>();
            container.For<IXFormBuilder>().Use<XFormBuilder>();

            container.For<IFormTypeModelSynchronizer>().Use<FormTypeModelSynchronizer>();
            container.For<IFormFieldTypeSynchronizer>().Use<FormFieldTypeSynchronizer>();
        }
开发者ID:alfnilsson,项目名称:EPiServerStronglyTypedXForms,代码行数:10,代码来源:DependencyResolverInitialization.cs


示例16: RegisterComplex

 private static void RegisterComplex(ConfigurationExpression r)
 {
     r.For<IFirstService>().Singleton().Use<FirstService>();
     r.For<ISecondService>().Singleton().Use<SecondService>();
     r.For<IThirdService>().Singleton().Use<ThirdService>();
     r.For<ISubObjectOne>().Transient().Use<SubObjectOne>();
     r.For<ISubObjectTwo>().Transient().Use<SubObjectTwo>();
     r.For<ISubObjectThree>().Transient().Use<SubObjectThree>();
     r.For<IComplex>().Transient().Use<Complex>();
 }
开发者ID:vvs0205,项目名称:IocPerformance,代码行数:10,代码来源:StructureMapContainerAdapter.cs


示例17: DoCustomConfiguration

 private static void DoCustomConfiguration(ConfigurationExpression initializer)
 {
     foreach(var type in typeof(Program).Assembly.GetTypes())
     {
         foreach(ConfiguresStructureMap attribute in type.GetCustomAttributes(typeof(ConfiguresStructureMap), false))
         {
             attribute.Initialize(initializer, type);
         }
     }
 }
开发者ID:roend83,项目名称:git-tfs,代码行数:10,代码来源:Program.cs


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


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


示例20: ConfigureContainer

        private static void ConfigureContainer(ConfigurationExpression container)
        {
            container.For<IEpiServerDependenciesResolver>().Use<EpiServerDependenciesResolver>();
            container.For<IBlockHelper>().Use<BlockHelper>();
            container.For<IContextResolver>().Use<ContextResolver>();
            container.For<ILinkResolver>().Use<LinkResolver>()
                .Ctor<IEpiServerDependenciesResolver>().Is<EpiServerDependenciesResolver>();
 
            container.For<IEpiServerDependencies>()
                .Use<EpiServerDependencies>();
        }
开发者ID:jondjones,项目名称:JonDJones.com.EpiServerContentMigrationWithJson,代码行数:11,代码来源:StructureMapSetUp.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ConfigurationManager类代码示例发布时间:2022-05-24
下一篇:
C# ConfigurationBuilder类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap