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


C# ConfigurationExpression.For方法代码示例

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


在下文中一共展示了ConfigurationExpression.For方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

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

示例5: ConfigureContainer

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

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

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

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

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

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

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

示例11: AddGitChangeTypes

 public static void AddGitChangeTypes(ConfigurationExpression initializer)
 {
     // See git-diff-tree(1).
     initializer.For<IGitChangedFile>().Use<Add>().Named(GitChangeInfo.ChangeType.ADD);
     initializer.For<IGitChangedFile>().Use<Copy>().Named(GitChangeInfo.ChangeType.COPY);
     initializer.For<IGitChangedFile>().Use<Modify>().Named(GitChangeInfo.ChangeType.MODIFY);
     //initializer.For<IGitChangedFile>().Use<TypeChange>().Named(GitChangeInfo.GitChange.TYPECHANGE);
     initializer.For<IGitChangedFile>().Use<Delete>().Named(GitChangeInfo.ChangeType.DELETE);
     initializer.For<IGitChangedFile>().Use<RenameEdit>().Named(GitChangeInfo.ChangeType.RENAMEEDIT);
     //initializer.For<IGitChangedFile>().Use<Unmerged>().Named(GitChangeInfo.GitChange.UNMERGED);
     //initializer.For<IGitChangedFile>().Use<Unknown>().Named(GitChangeInfo.GitChange.UNKNOWN);
 }
开发者ID:JamesDunne,项目名称:git-tfs,代码行数:12,代码来源:Program.cs

示例12: AddGitChangeTypes

 public static void AddGitChangeTypes(ConfigurationExpression initializer)
 {
     // See git-diff-tree(1).
     initializer.For<IGitChangedFile>().Use<Add>().Named("A");
     initializer.For<IGitChangedFile>().Use<Copy>().Named("C");
     initializer.For<IGitChangedFile>().Use<Modify>().Named("M");
     //initializer.For<IGitChangedFile>().Use<TypeChange>().Named("T");
     initializer.For<IGitChangedFile>().Use<Delete>().Named("D");
     initializer.For<IGitChangedFile>().Use<RenameEdit>().Named("R");
     //initializer.For<IGitChangedFile>().Use<Unmerged>().Named("U");
     //initializer.For<IGitChangedFile>().Use<Unknown>().Named("X");
 }
开发者ID:roend83,项目名称:git-tfs,代码行数:12,代码来源:Program.cs

示例13: ConfigureInjections

        /// <summary>
        /// Configures all injections.
        /// </summary>
        /// <param name="obj"></param>
        private static void ConfigureInjections(ConfigurationExpression configuration)
        {
            configuration.For<IRepository<UserDto>>().HttpContextScoped().Use<Repository<UserDto>>();
            configuration.For<IUserRepository>().HttpContextScoped().Use<UserRepository>(); // this is necessary if we would like to use EF for example and make sure no 2 threads will access one DbContext.

            // For demo purposes, Im using a single source throughout the whole app.
            configuration.For<IFeedSource>().Singleton().Use((() =>
                {
                    var source = new FeedSource<SimpleNewsGator>();
                    source.Subscribe(new FeedDispatcher(new FeedItemHub()));
                    source.Start();
                    return source;
                }));
        }
开发者ID:jaroosh,项目名称:sampleFeedR,代码行数:18,代码来源:StructuremapMvc.cs

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

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


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