I have the following function written for dot net 3.5 that uses "ElementAt()" to successively return a value from a dictionary collection.
Since I need this to run in dot net 2.0 I cannot use ElementAt()
I think I can re-write it like this but I'm not sure.
Anybody know a better way to handle this?
VB.NET:
Public Function GetNextEntryInfo() As EntryInfo
If mFileInfo.Count > mIndexLoc Then
Dim entry As EntryInfo = mFileInfo.ElementAt(mIndexLoc).Value
mIndexLoc += 1
Return entry
Else
Return Nothing
End If
End Function
I think I can re-write it like this but I'm not sure.
VB.NET:
Public Function GetNextEntryInfo() As EntryInfo
Dim pair As KeyValuePair(Of String, EntryInformation)
If mFileInformation.Count > mIndexLocation Then
Dim tmpcount = 1
For Each pair In mFileInformation
If tmpcount < mIndexLocation Then
tmpcount += 1
ElseIf tmpcount = mIndexLocation Then
mIndexLocation += 1
Return pair.Value
End If
Next
Else
Return Nothing
End If
End Function