Hi Saso,
One suggestion would be to create a custom type,
(say something like the MyEntry class shown below)
that contains the fields (In your example -
object myObject, int myInt, string myString)
that comprise the entries to be added to the collection.
You can then add/remove instances of the MyEntry class
from a collection such as the ArrayList.
public class MyEntry
{
private object _myObject;
private int _myInt;
private string _myString;
// Expose a few public properties here to
// access/modify the private fields
// ...
}
ArrayList list = new ArrayList();
list.Add(new MyEntry(myObj, myInt, myString));
You could also create a strongly typed collection
class derived from CollectionBase that could allow you to
add and remove instances of MyEntry.
Regards,
Aravind C
"Saso Zagoranski" <sa*************@guest.arnes.si> wrote in message
news:c0**********@planja.arnes.si...
Hi!
I need an array-type of collection when the entries would look like:
object myObject, int myInt, string myString
Which collection should I use?
I know I could declare a multidimensional array of objects but adding and
deleting to that
array would require distribution of objects each time something was
deleted or added so
that doesn't feel like the correct approach.
Thanks,
saso