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