示例#1
0
 public NavigationService(BehaviorGraph graph, ICurrentHttpRequest request, IMenuStateService stateService, IUrlRegistry urls)
 {
     _request = request;
     _stateService = stateService;
     _urls = urls;
     _navigation = graph.Settings.Get<NavigationGraph>();
 }
示例#2
0
 public NavigationService(BehaviorGraph graph, ICurrentHttpRequest request, IMenuStateService stateService, IUrlRegistry urls)
 {
     _request      = request;
     _stateService = stateService;
     _urls         = urls;
     _navigation   = graph.Settings.Get <NavigationGraph>();
 }
        public void add_node_and_parent_does_not_exist()
        {
            var graph = new NavigationGraph();

            var node = MenuNode.Node(FakeKeys.Key1);

            graph.AddNode(FakeKeys.Key2, node);

            graph.MenuFor(FakeKeys.Key2).Top
                .ShouldBeTheSameAs(node);
        }
示例#4
0
        public void Configure(NavigationGraph graph)
        {
            var dependency = graph.AllNodes().FirstOrDefault(node => _matcher.Matches(node.Key));

            // code was like this for debugging
            if (dependency == null)
            {
                dependency = graph.MenuFor(_matcher.DefaultKey());
            }

            _strategy.Apply(dependency, _node);
        }
        public void add_node_to_another_node()
        {
            var graph = new NavigationGraph();
            var parentNode = MenuNode.Node(FakeKeys.Key1);
            graph.AddNode(FakeKeys.Key2, parentNode);

            var childNode = MenuNode.Node(FakeKeys.Key3);

            graph.AddNode(FakeKeys.Key1, childNode);

            parentNode.Children.Top
                .ShouldBeTheSameAs(childNode);
        }
示例#6
0
        public void Configure(NavigationGraph graph)
        {
            var dependency = graph.AllNodes().FirstOrDefault(node => _matcher.Matches(node.Key));

            // code was like this for debugging
            if (dependency == null)
            {
                dependency = graph.MenuFor(_matcher.DefaultKey());
            }



            _strategy.Apply(dependency, _node);
        }
示例#7
0
 internal void Configure(NavigationGraph graph)
 {
     _modifications.Each(x => x(graph));
 }
 public void Configure(ActionCall action, MenuItemAttribute att, NavigationGraph graph)
 {
     var registrations = att.ToMenuRegistrations(action.ParentChain());
     graph.AddRegistrations(registrations);
 }
        public void Configure(ActionCall action, MenuItemAttribute att, NavigationGraph graph)
        {
            var registrations = att.ToMenuRegistrations(action.ParentChain());

            graph.AddRegistrations(registrations);
        }
示例#10
0
 internal void Configure(NavigationGraph graph)
 {
     graph.AddRegistrations(_registrations);
 }
示例#11
0
        public void SetUp()
        {
            graph = new NavigationGraph(x =>
            {
                x.ForMenu(FakeKeys.Key1);
                x.Add += MenuNode.Node(FakeKeys.Key2);
                x.Add += MenuNode.Node(FakeKeys.Key3);
                x.Add += MenuNode.Node(FakeKeys.Key4);

                x.ForMenu(FakeKeys.Key5);
                x.Add += MenuNode.Node(FakeKeys.Key6);
                x.Add += MenuNode.Node(FakeKeys.Key7);

                x.ForMenu(FakeKeys.Key2);
                x.Add += MenuNode.Node(FakeKeys.Key8);
                x.Add += MenuNode.Node(FakeKeys.Key9);

                x.ForMenu(FakeKeys.Key9);
                x.Add += MenuNode.Node(FakeKeys.Key10);
            });
        }
示例#12
0
 internal void Configure(NavigationGraph graph)
 {
     graph.AddRegistrations(_registrations);
 }