public T AddChildNode <T>(T child, Position position) where T : XmlPortNode
        {
            switch (position)
            {
            case Position.FirstWithinContainer:
                Container.Insert(Index + 1, child);
                break;

            case Position.LastWithinContainer:
                var lastIndex = Descendants.Any() ? Descendants.Last().Index : Index;
                Container.Insert(lastIndex + 1, child);
                break;
            }

            return(child);
        }
Exemplo n.º 2
0
 public bool HasChild(T value)
 {
     return(Descendants.Any(vertex => Equals(vertex.Value, value)));
 }