當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。