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))); }
public AreaInstance Visit(ContainerInstance container, IEnumerable <int> path) { return(container.Components.Select(c => c.Accept(this, path)).FirstOrDefault(a => a != null)); }