Example #1
0
        public ComponentInstance Visit(ContainerInstance container, IEnumerable <int> path)
        {
            if (!path.Any())
            {
                return(container);
            }

            if (container.Components.Count() < path.First())
            {
                throw new KolaException("No component at specified path");
            }

            return(container.Components.ElementAt(path.First()).Accept(this, path.Skip(1)));
        }
Example #2
0
 public AreaInstance Visit(ContainerInstance container, IEnumerable <int> path)
 {
     return(container.Components.Select(c => c.Accept(this, path)).FirstOrDefault(a => a != null));
 }