Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public MenuResolverCache(IChainResolver resolver, NavigationGraph graph)
        {
            _inner = new Lazy <NavigationGraph>(() => {
                graph.Compile();
                graph.AllNodes().OfType <MenuNode>().Each(x =>
                {
                    try
                    {
                        x.Resolve(resolver);
                    }
                    catch (Exception ex)
                    {
                        throw new FubuException(4001, ex, "Failed to resolve a BehaviorChain for navigation element " + x.Key);
                    }
                });

                return(graph);
            });
        }
Ejemplo n.º 4
0
        public MenuResolverCache(IChainResolver resolver, NavigationGraph graph)
        {
            _inner = new Lazy<NavigationGraph>(() => {
                graph.Compile();
                graph.AllNodes().OfType<MenuNode>().Each(x =>
                {
                    try
                    {
                        x.Resolve(resolver);
                    }
                    catch (Exception ex)
                    {
                        throw new FubuException(4001, ex, "Failed to resolve a BehaviorChain for navigation element " + x.Key);
                    }

                });

                return graph;
            });
        }