private void VisitChannelsDepthFromTopRec(Channel channel, int depth, ChannelsDepthVisitor visitor) { visitor(channel, depth); foreach (var child in channel.Connecions) { VisitChannelsDepthFromTopRec(child, depth + 1, visitor); } }
public void VisitChannelsDepthFromTop(Channel baseChannel, ChannelsDepthVisitor visitor) { VisitChannelsDepthFromTopRec(baseChannel, 0, visitor); }