G
Guest
Hello All:
I am writing a function which accepts an ArrayList as its parameter and
converts the contents of the ArrayList into an XmlNodeList. The ArrayList
will contain one of several different structures. For example, the
structures could be either a Customer structure (which contains a customer id
and name) or an Address structure (which contains an address type and street
number, city, etc). The XmlNodeList is uded to populate a DropDownList where
the id or address type are the ListItem's value and other information is the
ListItem's text.
I want the function to determine which structure is in the ArrayList
(Customer or Address) and cast the ArrayList entry appropriately. I can code
everything except the how to determine which structure is in the ArrayList.
For example:
Public Function Foo(AL as ArrayList) as XmlNodeList
Dim e as System.Collections.iEnumerator = AL.GetEnumerator
Do While e.MoveNext
' Determine which structure is contained in e.Current
' Perform other tasks with the e.Current entry of the ArrayList
Loop
'return some XmlNodeList
End Function
Does anyone know how to do this?
TIA,
I am writing a function which accepts an ArrayList as its parameter and
converts the contents of the ArrayList into an XmlNodeList. The ArrayList
will contain one of several different structures. For example, the
structures could be either a Customer structure (which contains a customer id
and name) or an Address structure (which contains an address type and street
number, city, etc). The XmlNodeList is uded to populate a DropDownList where
the id or address type are the ListItem's value and other information is the
ListItem's text.
I want the function to determine which structure is in the ArrayList
(Customer or Address) and cast the ArrayList entry appropriately. I can code
everything except the how to determine which structure is in the ArrayList.
For example:
Public Function Foo(AL as ArrayList) as XmlNodeList
Dim e as System.Collections.iEnumerator = AL.GetEnumerator
Do While e.MoveNext
' Determine which structure is contained in e.Current
' Perform other tasks with the e.Current entry of the ArrayList
Loop
'return some XmlNodeList
End Function
Does anyone know how to do this?
TIA,