Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic, Loosely Coupled, Collection Search

Status
Not open for further replies.

stravis

Programmer
Jun 28, 2003
420
US
Hello,

I am trying to create a function on a collection class that is inheriting from the CollectionBase class that allows searching for an object in the collection based on a user provided value and property name. The signature would look something like the following:
Code:
Function IndexOf(byval value as Object, propertyName as String) as Integer

I know I could hard code in a select case statement to perform different searches for each possible propertyName value, but I would like to create something that is a little more dynamic.

Is there some way that I can do this using reflection or some other means?

Thanks,
stravis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top