I've been looking at the HashTable and it seems complicated. I have a simple class that has an ID, X, Y and thats it. I want an array/collection of my object that uses the ID as the index.
So when I receive a new object I could do the following
myObjectList[newObject.ID]
My goal is to not duplicate objects in the list. As I said I'm used to CMapStringToPtr maps in MFC
Main Topics
Browse All Topics





by: ThogekPosted on 2007-05-17 at 17:35:55ID: 19112949
Depending on exactly what you're working with and trying to do, a Hashtable might do you well. (See http://msdn2.microsoft.com /en-us/lib rary/ syste m.collecti ons.hashta ble.aspx.)
ized (http://msdn2.microsoft.co m/en-us/li brary/ syst em.collect ions.speci alized.asp x).
There're also an interesting assortment of built-in collections in System.Collections.Special