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.Coun t
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.Collecti ons.IEnumerable .GetEnumerator
Return New StudentEnumerat or( m_students )
End Function
End Class
---------------------
Cheers!
--
Jay Douglas
Fort Collins, CO
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.Coun t
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.Collecti ons.IEnumerable .GetEnumerator
Return New StudentEnumerat or( m_students )
End Function
End Class
---------------------
Cheers!
--
Jay Douglas
Fort Collins, CO
Comment