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:
Imports System Namespace QuestionTree Public MustInherit Class HierarchyElement Private _id As Integer Private name as String Public ReadOnly Property Name() As String Get Return _name End Get End Property Public ReadOnly Property Id() As Integer Get End Get End Property Protected Sub New(ByVal _name As String, ByVal _id As Integer) Me._name = _name Me._id = _id End Sub End Class Public Class SectionElement Inherits HierachyElement Public Sub New(ByVal _name As String, ByVal _id As Integer) MyBase.New(_name, _id) End Sub End Class Public Class SubsectionElement Inherits HierachyElement Public Sub New(ByVal _name As String, ByVal _id As Integer) MyBase.New(_name, _id) End Sub End Class Public Class QuestionElement Inherits HierachyElement Public Enum AnswerType ANSWER_TYPE_CHECKBOX ANSWER_TYPE_RADIO End Enum Private _answerType As AnswerType Private [_text] As String Private answered As Boolean Public Sub New(ByVal [_text] As String, ByVal _id As Integer, ByVal _answerType As AnswerType) MyBase.New("question", _id) Me._text = [_text] Me._answerType = _answerType End Sub Public ReadOnly Property [Text]() As String Get Return [_text] End Get End Property Public Property Answered() As Boolean Get Return _answered End Get Set(ByVal Value As Boolean) _answered = Value End Set End Property End Class End Namespace
Anyone able to help me out?![]()



Reply With Quote