I have the following class file...
VB Code:
<Serializable()> Public Class GroupMember Public Name As String Public ID As String Public Random As Double End Class <Serializable()> Public Class GroupMemberCollection Inherits System.Collections.CollectionBase Public GroupName As String Public GroupStatus As String Public Sub Add(ByVal Member As GroupMember) ' Invokes Add method of the List object to add a widget. List.Add(Member) End Sub Public Sub Remove(ByVal index As Integer) ' Check to see if there is a GroupMember at the supplied index. If index > Count - 1 Or index < 0 Then ' If no GroupMember exists, a messagebox is shown and the operation is ' cancelled. System.Windows.Forms.MessageBox.Show("Index not valid!") Else ' Invokes the RemoveAt method of the List object. List.RemoveAt(index) End If End Sub Public ReadOnly Property Members(ByVal index As Integer) As GroupMember Get ' The appropriate item is retrieved from the List object and ' explicitly cast to the GroupMember type, then returned to the ' caller. Return CType(List.Item(index), GroupMember) End Get End Property End Class
I am using Serialization to save instances of this class (group files)... My problem is that when it serializes, it only saves the information for the last index of Members within the GroupMembersCollection...
So when I deserialize and try the following loop...
VB Code:
For i = 0 to GroupCollection.Count - 1 MsgBox(GroupCollection.Members(i).Name) Next i
I get the last name in the collection over and over and over again.
Can someone help me here?
Thanks,
Squirrelly1




Life is grand for a coder, no?
Reply With Quote