AmosFiveSix.com

Experience, Knowledge, Creativity

  • Increase font size
  • Default font size
  • Decrease font size
Home QueryTree for VB.Net QueryTree.Nodes.vb

QueryTree.Nodes.vb

E-mail Print PDF

See my portfolio for information on the Document Builder project that used the Query Tree component.

The Nodes class is a simple subclass of Collection(Of T) for the Node objects. It overloads the item property so callers can look up a node by name.


Namespace NACS.Data.QueryTree

    Public Class Nodes

        Inherits System.Collections.ObjectModel.Collection(Of Node)

        Private m_oParent As Node = Nothing

        Public Property Parent() As Node

            Get

                Return m_oParent

            End Get

            Friend Set(ByVal oParent As Node)

                m_oParent = oParent

            End Set

        End Property

        Public Overloads ReadOnly Property Item(ByVal sName As String) As Node

            Get

                For Each oNode As Node In Me

                    If oNode.Name.Equals(sName) Then

                        Return oNode

                    End If

                Next

                Throw New IndexOutOfRangeException

            End Get

        End Property


    End Class

End Namespace