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


C# BehaviorGraph.AddChain方法代码示例

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


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

示例1: addBuiltInDiagnostics

 private static void addBuiltInDiagnostics(BehaviorGraph graph)
 {
     if (FubuMode.InDevelopment())
     {
         graph.AddChain(RoutedChain.For<AboutDiagnostics>(x => x.get__about(), "_about"));
         graph.AddChain(RoutedChain.For<AboutDiagnostics>(x => x.get__loaded(), "_loaded"));
     }
 }
开发者ID:jrios,项目名称:fubumvc,代码行数:8,代码来源:BehaviorGraphBuilder.cs

示例2: SetUp

 public void SetUp()
 {
     _outputPolicy = new AttachOutputPolicy();
     _graph = new BehaviorGraph();
     _graph.AddChain(BehaviorChain.For<TestEndpoint>(e => e.X()));
     _graph.AddChain(BehaviorChain.For<TestEndpoint>(e => e.AnyNumber()));
     _outputPolicy.Configure(_graph);
 }
开发者ID:NeilSorensen,项目名称:fubumvc,代码行数:8,代码来源:AttachOutputPolicyTester.cs

示例3: Configure

        public void Configure(BehaviorGraph graph)
        {
            if (!HasLogin(graph))
            {
                graph.AddChain().AddToEnd(ActionCall.For<LoginController>(x => x.Login(null)));
            }

            if (!HasLogout(graph))
            {
                graph.AddChain().AddToEnd(ActionCall.For<LogoutController>(x => x.Logout(null)));
            }
        }
开发者ID:mtscout6,项目名称:FubuMVC.Authentication,代码行数:12,代码来源:FormsAuthenticationEndpointsRegistration.cs

示例4: should_throw_an_exception_if_the_result_is_not_unique

        public void should_throw_an_exception_if_the_result_is_not_unique()
        {
            var call1 = ActionCall.For<Issue101Endpoint>(x => x.get_hello());
            var call2 = ActionCall.For<Issue101Endpoint>(x => x.get_hello());

            var graph = new BehaviorGraph();
            graph.AddChain().AddToEnd(call1);
            graph.AddChain().AddToEnd(call2);

            Exception<FubuException>.ShouldBeThrownBy(() => {
                graph.ChainFor<Issue101Endpoint>(x => x.get_hello());
            });
        }
开发者ID:cothienlac86,项目名称:fubumvc,代码行数:13,代码来源:Issue101.cs

示例5: Configure

        public void Configure(BehaviorGraph graph)
        {
            var handlers = graph.Settings.Get<HandlerGraph>();

            // TODO -- move this to a HandlerSource after we fix the duplicate calls
            // across HandlerSource problem.
            handlers.Add(HandlerCall.For<SubscriptionsHandler>(x => x.Handle(new SubscriptionRequested())));
            handlers.Add(HandlerCall.For<SubscriptionsHandler>(x => x.Handle(new SubscriptionsChanged())));

            handlers.ApplyGeneralizedHandlers();

            var policies = graph.Settings.Get<HandlerPolicies>();
            handlers.ApplyPolicies(policies.GlobalPolicies);

            foreach (var chain in handlers)
            {
                // Apply the error handling node
                chain.InsertFirst(new ExceptionHandlerNode(chain));

                graph.AddChain(chain);

                // Hate how we're doing this, but disable tracing
                // on the polling job requests here.
                if (chain.InputType().Closes(typeof (JobRequest<>)))
                {
                    chain.Tags.Add(BehaviorChain.NoTracing);
                }
            }
        }
开发者ID:JackGilliam1,项目名称:FubuTransportation,代码行数:29,代码来源:ImportHandlers.cs

示例6: createAssetContentChain

 private static BehaviorChain createAssetContentChain(BehaviorGraph graph)
 {
     var chain = graph.AddChain();
     var pattern = "_content";
     chain.Route = RouteBuilder.Build(typeof(AssetPath), pattern);
     chain.Route.AddHttpMethodConstraint("GET");
     return chain;
 }
开发者ID:roend83,项目名称:fubumvc,代码行数:8,代码来源:AssetContentEndpoint.cs

示例7: has_logout_positive

        public void has_logout_positive()
        {
            var graph = new BehaviorGraph();
            graph.AddChain().AddToEnd(ActionCall.For<LoginEndpoint>(x => x.get_logout(null)));

            FormsAuthenticationEndpointsRegistration.HasLogout(graph)
                .ShouldBeTrue();
        }
开发者ID:RobertTheGrey,项目名称:FubuMVC.Authentication,代码行数:8,代码来源:FormsAuthenticationEndpointsRegistrationTester.cs

示例8: addReloadedEndpoint

        private static void addReloadedEndpoint(BehaviorGraph graph)
        {
            var action = ActionCall.For<AboutEndpoint>(x => x.get__loaded());
            var chain = new BehaviorChain();
            chain.AddToEnd(action);
            chain.Route = new RouteDefinition("_loaded");

            graph.AddChain(chain);
        }
开发者ID:mtscout6,项目名称:fubumvc,代码行数:9,代码来源:RegisterAbout.cs

示例9: createAssetContentChain

        private static BehaviorChain createAssetContentChain(BehaviorGraph graph)
        {
            var chain = graph.AddChain();

            chain.Route = RouteBuilder.Build(typeof (AssetPath), Pattern);
            chain.Route.AddHttpMethodConstraint("GET");
            chain.Route.SessionStateRequirement = SessionStateRequirement.DoesNotUseSessionState;
            return chain;
        }
开发者ID:ahjohannessen,项目名称:fubumvc,代码行数:9,代码来源:AssetContentEndpoint.cs

示例10: Configure

 public void Configure(BehaviorGraph graph)
 {
     var route = new RouteDefinition("");
     route.AddHttpMethodConstraint("GET");
     var chain = new BehaviorChain { Route = route };
     chain.AddToEnd(new RedirectNode());
     graph.AddChain(chain);
     graph.Services.AddService(this);
 }
开发者ID:mikeobrien,项目名称:FubuMVC.RegexUrlPolicy,代码行数:9,代码来源:DefaultDocument.cs

示例11: Configure

 public void Configure(BehaviorGraph graph)
 {
     _sources
         .SelectMany(src => src.FindActions(_types))
         .Each(call =>
                   {
                       var chain = new BehaviorChain();
                       chain.AddToEnd(call);
                       graph.AddChain(chain);
                   });
 }
开发者ID:jemacom,项目名称:fubumvc,代码行数:11,代码来源:BehaviorAggregator.cs

示例12: Configure

        public void Configure(BehaviorGraph graph)
        {
            var actions = _source.FindActions(graph.ApplicationAssembly);

            var existing = graph.Actions().ToList();

            actions.Where(x => !existing.Contains(x)).Each(call => {
                var chain = new BehaviorChain();
                chain.AddToEnd(call);
                graph.AddChain(chain);
            });
        }
开发者ID:NeilSorensen,项目名称:fubumvc,代码行数:12,代码来源:BehaviorAggregator.cs

示例13: buildChain

        private void buildChain(BehaviorGraph graph, Type t)
        {
            var chain = graph.AddChain();
            chain.Origin = "SmartGridConvention";
            chain.Route = new RouteDefinition("_griddata/" + t.NameForGrid().ToLower());

            var call = typeof (GridActionCall<>).CloseAndBuildAs<ActionCall>(t);
            chain.AddToEnd(call);

            t.GetAllAttributes<ModifyChainAttribute>().Each(att => att.Alter(call));

            chain.MakeAsymmetricJson();
        }
开发者ID:DarthFubuMVC,项目名称:FubuFastPack,代码行数:13,代码来源:SmartGridConvention.cs

示例14: Configure

        public void Configure(BehaviorGraph graph)
        {
            // This needs to be forced to true here
            _types.ShouldScanAssemblies = true;
            _types.TypesMatching(_viewTypeFilter).Each(type =>
            {
                var chain = graph.AddChain();
                var node = _facilities.FirstValue(x => x.CreateViewNode(type));
                chain.AddToEnd(node);

                _configureChain(chain);
            });
        }
开发者ID:RobertTheGrey,项目名称:fubumvc,代码行数:13,代码来源:ViewExpression.cs

示例15: Configure

        public void Configure(BehaviorGraph graph)
        {
            if (!_views.Views.Any()) return;

            FindLastActions(graph.Behaviors).Each(attachToAction);

            _views.Views.Where(x => x.ViewModel != null && !_attached.Contains(x)).Each(view => {
                var chain = buildChainForView(view);
                chain.Output.AddView(view, Always.Flyweight);

                graph.AddChain(chain);
            });
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:13,代码来源:ViewAttacher.cs


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