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


C# BehaviorGraph.BehaviorFor方法代码示例

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


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

示例1: SetUp

        public void SetUp()
        {
            theHttpRequest = OwinHttpRequest.ForTesting();
            UrlContext.Stub("http://server");

            theUrlResolver = new ChainUrlResolver(theHttpRequest);

            theGraph = BehaviorGraph.BuildFrom(registry =>
            {
                registry.Actions.IncludeType<ChainUrlResolverEndpoint>();
            });

            theSimpleChain = theGraph.BehaviorFor<ChainUrlResolverEndpoint>(x => x.get_index());
            theChainWithRouteParams = theGraph.BehaviorFor(typeof(ChainUrlParams));
        }
开发者ID:swcomp,项目名称:fubumvc,代码行数:15,代码来源:ChainUrlResolverTester.cs

示例2:

        void IConfigurationAction.Configure(BehaviorGraph graph)
        {
            var chain = graph.BehaviorFor(_route);
            _nodes.Each(chain.AddToEnd);

            //graph.Observer.RecordStatus("Adding explicit route {0}".ToFormat(_route));
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:7,代码来源:ExplicitRouteConfiguration.cs

示例3: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry(x => {
                x.Actions.IncludeClassesSuffixedWithController();

                x.Configure(g =>
                {
                    g.BehaviorFor<AuthorizedController>(c => c.Go(null)).Authorization.AddRole("RoleA");
                });
            });

            graph = BehaviorGraph.BuildFrom(registry);

            goChain = graph.BehaviorFor<AuthorizedController>(x => x.Go(null));
            moveChain = graph.BehaviorFor<AuthorizedController>(x => x.Move(null));
        }
开发者ID:NeilSorensen,项目名称:fubumvc,代码行数:16,代码来源:system_policy_for_authorization.cs

示例4: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry(x =>
            {
                x.Actions.IncludeTypesNamed(t => t.EndsWith("Controller"));

                x.Configure(g =>
                {
                    g.BehaviorFor<AuthorizedController>(c => c.Go()).Authorization.AddRole("RoleA");
                });
            });

            graph = registry.BuildGraph();

            goChain = graph.BehaviorFor<AuthorizedController>(x => x.Go());
            moveChain = graph.BehaviorFor<AuthorizedController>(x => x.Move());
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:17,代码来源:system_policy_for_authorization.cs

示例5: Configure

 public void Configure(BehaviorGraph graph)
 {
     var chain = graph.BehaviorFor<TwitterController>(x => x.Button(null));
     if (!chain.Output.HasView(typeof(Always)))
     {
         chain.Output.Writers.AddToEnd(new WriteDefaultTwitterButton());
     }
 }
开发者ID:RobertTheGrey,项目名称:FubuMVC.Authentication,代码行数:8,代码来源:AttachDefaultTwitterView.cs

示例6: Configure

 public void Configure(BehaviorGraph graph)
 {
     var chain = graph.BehaviorFor<InlineModelEndpoint>(e => e.post_inline_model(null));
     var validation = chain.ValidationNode();
     if(validation != null)
     {
         validation.Strategies.RegisterStrategy(RenderingStrategy.Inline);
     }
 }
开发者ID:thunklife,项目名称:fubuvalidation,代码行数:9,代码来源:ValidationApplication.cs

示例7: Configure

        public void Configure(BehaviorGraph graph)
        {
            var chain = graph.BehaviorFor(typeof (ValidationSummary));
            if (chain == null) return;

            if (!chain.Output.HasView(typeof(Always)))
            {
                chain.Output.Writers.AddToEnd(new DefaultValidationSummaryNode());
            }
        }
开发者ID:stevematney,项目名称:fubuvalidation,代码行数:10,代码来源:AttachDefaultValidationSummary.cs

示例8: Configure

        public void Configure(BehaviorGraph graph)
        {
            var chain = graph.BehaviorFor<LoginController>(x => x.Login(null));
            if (chain == null) return;

            if(!chain.Output.HasView(typeof(Always)))
            {
               chain.Output.Writers.AddToEnd(new WriteDefaultLogin()); 
            }
        }
开发者ID:mtscout6,项目名称:FubuMVC.Authentication,代码行数:10,代码来源:AttachDefaultLoginView.cs

示例9: action_without_json_attributes_or_JsonMessage_input_model_has_no_conneg

        public void action_without_json_attributes_or_JsonMessage_input_model_has_no_conneg()
        {
            // You have to make the endpoint get some sort of reader/writer to test the negative case,
            // otherwise the default "use json & xml if nothing else is provided" convention
            // takes over
            var registry = new FubuRegistry();
            registry.Actions.IncludeType<JsonController>();
            registry.Configure(graph =>
            {
                graph.Behaviors.Where(x => x.InputType() == typeof (Input1)).Each(chain =>
                {
                    chain.Input.AddFormatter<XmlFormatter>();
                    chain.Output.AddFormatter<XmlFormatter>();
                });
            });

            theGraph = BehaviorGraph.BuildFrom(registry);

            var theChain = theGraph.BehaviorFor(typeof (Input1));

            theChain.Input.UsesFormatter<JsonFormatter>().ShouldBeFalse();
            theChain.Output.UsesFormatter<JsonFormatter>().ShouldBeFalse();
        }
开发者ID:roend83,项目名称:fubumvc,代码行数:23,代码来源:JsonMessageInputConventionTester.cs

示例10: SetUp

        public void SetUp()
        {
            theRegistry = new LoggedFubuRegistry();

            // Do it this way so that it gets the assembly package
            container = new Container();
            theGraph = FubuApplication.For(theRegistry).StructureMap(container)
                .Bootstrap().Factory.Get<BehaviorGraph>();

            theGraph.BehaviorFor<LoggedEndpoint>(x => x.get_logged_hello()).ShouldNotBeNull();

            theLogs = container.GetInstance<ConfigLog>();
        }
开发者ID:mtscout6,项目名称:fubumvc,代码行数:13,代码来源:BehaviorGraph_logging_integration_tester.cs

示例11: SetUp

        public void SetUp()
        {
            FubuTransport.AllQueuesInMemory = true;

            container = new Container();
            container.Inject(new TransportSettings
            {
                DelayMessagePolling = Int32.MaxValue,
                ListenerCleanupPolling = Int32.MaxValue
            });
            theServiceBus = MockRepository.GenerateMock<IServiceBus>();

            theRuntime = FubuApplication.DefaultPolicies().StructureMap(container).Bootstrap();
            theGraph = theRuntime.Factory.Get<BehaviorGraph>();
            chain = theGraph.BehaviorFor<MessageOnePublisher>(x => x.post_message1(null));

            container.Inject(theServiceBus);
        }
开发者ID:JackGilliam1,项目名称:FubuTransportation,代码行数:18,代码来源:PublishingConfigurationIntegrationTester.cs

示例12:

 void IConfigurationAction.Configure(BehaviorGraph graph)
 {
     graph.BehaviorFor(_route).AddToEnd(_topBehavior);
     //graph.Observer.RecordStatus("Adding explicit route {0}".ToFormat(_route));
 }
开发者ID:JamieDraperUK,项目名称:fubumvc,代码行数:5,代码来源:ExplicitRouteConfiguration.cs

示例13:

 void IConfigurationAction.Configure(BehaviorGraph graph)
 {
     graph.BehaviorFor(_route).Append(_topBehavior);
 }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:4,代码来源:ExplicitRouteConfiguration.cs

示例14: SetUp

        public void SetUp()
        {
            FubuMode.Reset();

            _runtime = FubuApplication.For<ApplicationRegistry>().StructureMap().Bootstrap();
            behaviors = _runtime.Factory.Get<BehaviorGraph>();

            appChain = behaviors.BehaviorFor<ApplicationActions>(x => x.get_app_action());
            pakChain = behaviors.BehaviorFor<PackageActions>(x => x.get_pak_action());
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:10,代码来源:FubuPackageRegistry_Importing_Mechanics_Specs.cs


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