J
Jay Douglas
I found an example that teaches me how to create my own collections ... but
the best one that I can find is in VB. I don't know how to convert the VB
"Implements" in to C# friendly code.. Could someone please help me convert
the snippet of code or provide a link to a good C# collections tutorial ...
Thanks.
-----------------------------------
Public Class Students
Implements IEnumerable
Private m_students As New ArrayList()
Public Sub New()
End Sub
Public ReadOnly Property Count() As Int32
Get
Return m_students.Count
End Get
End Property
Public Sub AddStudent( ByVal student As Student )
m_students.Add(student)
End Sub
' Impelementation of IEnumerable
Public Function GetEnumerator() As IEnumerator _
Implements System.Collections.IEnumerable.GetEnumerator
Return New StudentEnumerator( m_students )
End Function
End Class
the best one that I can find is in VB. I don't know how to convert the VB
"Implements" in to C# friendly code.. Could someone please help me convert
the snippet of code or provide a link to a good C# collections tutorial ...
Thanks.
-----------------------------------
Public Class Students
Implements IEnumerable
Private m_students As New ArrayList()
Public Sub New()
End Sub
Public ReadOnly Property Count() As Int32
Get
Return m_students.Count
End Get
End Property
Public Sub AddStudent( ByVal student As Student )
m_students.Add(student)
End Sub
' Impelementation of IEnumerable
Public Function GetEnumerator() As IEnumerator _
Implements System.Collections.IEnumerable.GetEnumerator
Return New StudentEnumerator( m_students )
End Function
End Class