C
Chris
Hi There,
I encountered Problems using ArrayList objects.
My question is:
How can I search members of objects (i.e. object.Member) in my ArrayList???
Purpose: I want to see if I have objects of a certain address in my list,
and if not,
i want to create some accordingly and append them to the list.
In my project I have:
----------------------------------------------------------------------
class CElement
{
public uint Address;
public string Data;
public string OtherData;
....
}
ArrayList arrayList = new ArrayList();
....
CElement obj = new CElement();
obj.Address=1234;
....
arrayList.Add(obj);
....
if ( arrayList.Contains(obj.Address) ) //this does not work
CElement match = (CElement) arrayList[arrayList.IndexOf(obj.Address)]
I encountered Problems using ArrayList objects.
My question is:
How can I search members of objects (i.e. object.Member) in my ArrayList???
Purpose: I want to see if I have objects of a certain address in my list,
and if not,
i want to create some accordingly and append them to the list.
In my project I have:
----------------------------------------------------------------------
class CElement
{
public uint Address;
public string Data;
public string OtherData;
....
}
ArrayList arrayList = new ArrayList();
....
CElement obj = new CElement();
obj.Address=1234;
....
arrayList.Add(obj);
....
if ( arrayList.Contains(obj.Address) ) //this does not work
CElement match = (CElement) arrayList[arrayList.IndexOf(obj.Address)]