when enumerating thru the properties of a type, how do I select only
the properties of the derived class? In the example below, the
AddrBookPrompt class is derived from the Form class. When I enumerate
the properties I get all the properties of the base class + the
properties of my derived class.
thanks,
AddrBookPrompt abPmt = new AddrBookPrompt();
abPmt.FirstName = "Steve";
abPmt.LastName = "Richter";
System.Type type = abPmt.GetType();
PropertyInfo[] piArray = type.GetProperties();
foreach (PropertyInfo pi in piArray)
{
ListViewItem item = new ListViewItem(pi.Name);
item.Tag = pi;
item.SubItems.Add(pi.PropertyType.Name);
item.SubItems.Add(pi.Module.Name );
mLvProperties.Items.Add(item);
}