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

C# Core.FubuRegistry类代码示例

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

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



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

示例1: SetUp

        public void SetUp()
        {
            registry = new FubuRegistry(x =>
            {
                x.Actions.IncludeTypes(t => false);

                // Tell FubuMVC to wrap the behavior chain for each
                // RouteHandler with the "FakeUnitOfWorkBehavior"
                // Kind of like a global [ActionFilter] in MVC
                x.Policies.ConditionallyWrapBehaviorChainsWith<FakeUnitOfWorkBehavior>(
                    call => call.Method.Name == "SomeAction");

                // Explicit junk you would only do for exception cases to
                // override the conventions
                x.Route("area/sub/{Name}/{Age}")
                    .Calls<TestController>(c => c.SomeAction(null)).OutputToJson();

                x.Route("area/sub2/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route("area/sub3/{Name}/{Age}")
                    .Calls<TestController>(c => c.ThirdAction(null)).OutputToJson();
            });

            _graph = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:ahjohannessen,项目名称:fubumvc,代码行数:26,代码来源:ConditionallyWrapBehaviorChainsWithTester.cs


示例2: alter_settings_modifies_settings_object

        public void alter_settings_modifies_settings_object()
        {
            var registry = new FubuRegistry(r => r.AlterSettings<SettingsObject>(so => so.Touched = true));

            BehaviorGraph.BuildFrom(registry)
                .Settings.Get<SettingsObject>().Touched.ShouldBeTrue();
        }
开发者ID:ahjohannessen,项目名称:fubumvc,代码行数:7,代码来源:FubuRegistryTester.cs


示例3: configure

        protected override void configure(FubuRegistry registry)
        {
            registry.Actions.IncludeType<HelloRazorController>();

            registry.Views
                .TryToAttachWithDefaultConventions();
        }
开发者ID:roend83,项目名称:fubumvc,代码行数:7,代码来源:RazorEngineIntegrationTester.cs


示例4: SetUp

 public void SetUp()
 {
     var registry = new FubuRegistry(x =>
     {
         //x.Route("some/route").Calls<ReportController>(o => o.BuildReport()).OutputToText();
     });
 }
开发者ID:joshuaflanagan,项目名称:fubumvc,代码行数:7,代码来源:RenderTextBehaviorTester.cs


示例5: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Actions.IncludeType<JsonController>();

            theGraph = registry.BuildGraph();
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:7,代码来源:JsonAttributeTesting.cs


示例6: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Actions.IncludeType<RouteAliasController>();

            theGraph = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:7,代码来源:UrlAliasAttributeTester.cs


示例7:

 void IFubuRegistryExtension.Configure(FubuRegistry registry)
 {
     registry.Actions.FindWith<GoogleEndpoints>();
     registry.Services<GoogleServiceRegistry>();
     registry.Policies.Add<AttachDefaultGoogleView>();
     registry.Extensions().For(new OAuth2ContentExtension<GoogleLoginRequest>());
 }
开发者ID:DarthFubuMVC,项目名称:FubuMVC.Authentication,代码行数:7,代码来源:ApplyGoogleAuthentication.cs


示例8: configure

        protected virtual void configure(FubuRegistry registry)
        {
            registry.Actions.IncludeType<SampleController>();

            registry.AlterSettings<AuthenticationSettings>(
                _ => _.Strategies.AddToEnd(MembershipNode.For<InMemoryMembershipRepository>()));
        }
开发者ID:cothienlac86,项目名称:fubumvc,代码行数:7,代码来源:AuthenticationHarness.cs


示例9: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Features.ServerSentEvents.Enable(true);

            theGraph = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:7,代码来源:ServerSentEventExtensionIntegratedTester.cs


示例10: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Features.Localization.Enable(true);

            graphWithBasicLocalizationAsIs = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:7,代码来源:LocalizationBootstrappingTester.cs


示例11: SetUp

        public void SetUp()
        {
            AssetDeclarationVerificationActivator.Latched = true;

            registry = new FubuRegistry(x =>
            {

                x.Route("area/sub/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route("area/sub2/prop")
                    .Calls<TestController>(c => c.SomeAction(null)).OutputToJson();

                x.Route("area/sub2/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route("area/sub2/{Name}")
                    .Calls<TestController>(c => c.ThirdAction(null)).OutputToJson();

                x.Route("area/sub3/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route("area/sub4/some_pattern")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
            });

            container = new Container();

            routes = FubuApplication.For(registry).StructureMap(container).Bootstrap().Where(r => !r.As<Route>().Url.StartsWith("_content")).ToList();

            container.Configure(x => x.For<IOutputWriter>().Use(new InMemoryOutputWriter()));
            Debug.WriteLine(container.WhatDoIHave());
        }
开发者ID:hartez,项目名称:fubumvc,代码行数:33,代码来源:FubuBootstrapperIntegrationTester.cs


示例12: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Import<YuiCompressionExtensions>();

            theServices = BehaviorGraph.BuildFrom(registry).Services;
        }
开发者ID:mtscout6,项目名称:FubuMVC.AssetTransforms,代码行数:7,代码来源:default_services_are_registered.cs


示例13: Configure

        public void Configure(FubuRegistry registry)
        {
            registry
                .Actions
                .FindWith<ExplicitControllerRegistration>();

            registry
                .Views
                .TryToAttachWithDefaultConventions()
                .TryToAttachViewsInPackages();

            registry
                .UseSpark(spark => spark.ConfigureComposer(c => c.AddBinder<DiagnosticsTemplateBinder>()));

            registry.Configure(graph =>
                                   {
                                       var chain = graph.FindHomeChain();
                                       if (chain == null)
                                       {
                                           graph
                                               .BehaviorFor<GettingStartedController>(x => x.Execute(new GettingStartedRequestModel()))
                                               .Route = new RouteDefinition(string.Empty);
                                       }
                                   });
        }
开发者ID:hartez,项目名称:fubumvc,代码行数:25,代码来源:GettingStartedExtension.cs


示例14: SetUp

        public void SetUp()
        {
            registry = new FubuRegistry(x =>
            {

                // Tell FubuMVC to enrich the behavior chain for each
                // RouteHandler with the "FakeUnitOfWorkBehavior"
                // Kind of like a global [ActionFilter] in MVC
                x.Policies.EnrichCallsWith<FakeUnitOfWorkBehavior>(
                    call => call.Method.Name == "SomeAction");

                // Explicit junk you would only do for exception cases to
                // override the conventions
                x.Route<InputModel>("area/sub/{Name}/{Age}")
                    .Calls<TestController>(c => c.SomeAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub2/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub3/{Name}/{Age}")
                    .Calls<TestController>(c => c.ThirdAction(null)).OutputToJson();
            });

            _graph = registry.BuildGraph();
        }
开发者ID:RobertTheGrey,项目名称:fubumvc,代码行数:25,代码来源:EnrichCallsWithTester.cs


示例15: SetUp

        public void SetUp()
        {
            registry = new FubuRegistry(x =>
            {
                x.Route<InputModel>("area/sub/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub2/prop")
                    .Calls<TestController>(c => c.SomeAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub2/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub2/{Name}")
                    .Calls<TestController>(c => c.ThirdAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub3/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
            });

            container = new Container();

            var bootstrapper = new StructureMapBootstrapper(container, registry);
            routes = new RouteCollection();

            bootstrapper.Bootstrap(routes);

            container.Configure(x => x.For<IOutputWriter>().Use(new InMemoryOutputWriter()));
            Debug.WriteLine(container.WhatDoIHave());
        }
开发者ID:cmdrkeem,项目名称:fubumvc,代码行数:30,代码来源:FubuBootstrapperIntegrationTester.cs


示例16: Configure

        public void Configure(FubuRegistry registry)
        {
            registry.Policies.Add<ApplyTracing>();
			registry.Policies.Add<DescriptionVisualizationPolicy>();
            registry.Policies.Add<DiagnosticChainsPolicy>();
            registry.Services<DiagnosticServiceRegistry>();

            registry.Configure(graph => {
                var settings = graph.Settings.Get<DiagnosticsSettings>();

                if (settings.TraceLevel == TraceLevel.Verbose)
                {
                    graph.Services.Clear(typeof(IBindingLogger));
                    graph.Services.AddService<IBindingLogger, RecordingBindingLogger>();

                    graph.Services.Clear(typeof(IBindingHistory));
                    graph.Services.AddService<IBindingHistory, BindingHistory>();

                    graph.Services.AddService<ILogListener, RequestTraceListener>();
                }

                if (settings.TraceLevel == TraceLevel.Production)
                {
                    graph.Services.AddService<ILogListener, ProductionModeTraceListener>();
                }
            });

            registry.Policies.Add<DefaultHome>();
        }
开发者ID:ryankelley,项目名称:FubuMVC.Diagnostics,代码行数:29,代码来源:DiagnosticsRegistration.cs


示例17: beforeAll

        public void beforeAll()
        {
            var registry = new FubuRegistry();
            registry.Actions.IncludeType<Controller1>();

            _graph = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:bobpace,项目名称:fubumvc,代码行数:7,代码来源:RouteRankingIntegratedTester.cs


示例18: Configure

        public void Configure(FubuRegistry registry)
        {
            locateTemplates();

            registry.Views.Facility(new SparkViewFacility(_composer));
            registry.Services(configureServices);
        }
开发者ID:GunioRobot,项目名称:fubumvc,代码行数:7,代码来源:SparkExtension.cs


示例19: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Services<ServerSentEventRegistry>();

            services = BehaviorGraph.BuildFrom(registry).Services;
        }
开发者ID:DarthFubuMVC,项目名称:FubuMVC.ServerSentEvents,代码行数:7,代码来源:ServicesRegistrationTester.cs


示例20: Configure

        public void Configure(FubuRegistry registry)
        {
            registry.Policies.Add<MenuItemAttributeConfigurator>();
            registry.Policies.Add<CompileNavigationStep>();

            registry.Services<NavigationServiceRegistry>();
        }
开发者ID:DarthFubuMVC,项目名称:FubuMVC.Navigation,代码行数:7,代码来源:NavigationRegistryExtension.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Querying.ChainSearch类代码示例发布时间:2022-05-26
下一篇:
C# Descriptions.Description类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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