I'm trying to use a class that a friend wrote for me, but he's not had much time ot help me out but has explained to me that I need to, in his own words:

"To read the information you can enumerate through the GenericTree using its IEnumerable interface"

I have no clue what that means, so that's where I need your help...

Here is the code for the class:

VB Code:
  1. Imports System
  2.  
  3. Namespace QuestionTree
  4.   Public MustInherit Class HierarchyElement
  5.     Private _id As Integer
  6.     Private name as String
  7.  
  8.     Public ReadOnly Property Name() As String
  9.       Get
  10.         Return _name
  11.       End Get
  12.     End Property
  13.  
  14.     Public ReadOnly Property Id() As Integer
  15.       Get
  16.       End Get
  17.     End Property
  18.  
  19.     Protected Sub New(ByVal _name As String, ByVal _id As Integer)
  20.       Me._name = _name
  21.       Me._id = _id
  22.     End Sub
  23.   End Class
  24.  
  25.   Public Class SectionElement
  26.     Inherits HierachyElement
  27.  
  28.     Public Sub New(ByVal _name As String, ByVal _id As Integer)
  29.       MyBase.New(_name, _id)
  30.     End Sub
  31.   End Class
  32.  
  33.   Public Class SubsectionElement
  34.     Inherits HierachyElement
  35.  
  36.     Public Sub New(ByVal _name As String, ByVal _id As Integer)
  37.       MyBase.New(_name, _id)
  38.     End Sub
  39.   End Class
  40.  
  41.   Public Class QuestionElement
  42.     Inherits HierachyElement
  43.  
  44.     Public Enum AnswerType
  45.       ANSWER_TYPE_CHECKBOX
  46.       ANSWER_TYPE_RADIO
  47.     End Enum
  48.  
  49.     Private _answerType As AnswerType
  50.     Private [_text] As String
  51.     Private answered As Boolean
  52.  
  53.     Public Sub New(ByVal [_text] As String, ByVal _id As Integer, ByVal _answerType As AnswerType)
  54.       MyBase.New("question", _id)
  55.       Me._text = [_text]
  56.       Me._answerType = _answerType
  57.     End Sub
  58.  
  59.     Public ReadOnly Property [Text]() As String
  60.       Get
  61.         Return [_text]
  62.       End Get
  63.     End Property
  64.  
  65.     Public Property Answered() As Boolean
  66.       Get
  67.         Return _answered
  68.       End Get
  69.       Set(ByVal Value As Boolean)
  70.         _answered = Value
  71.       End Set
  72.     End Property
  73.   End Class
  74. End Namespace


Anyone able to help me out?