What does the following (vastly simplified) code display?
using System;
namespace ReflectedProperty
{
public class Person
{
public Person() { }
}
}
using System;
namespace ReflectedProperty
{
public class Employee : Person
{
public Employee() { }
}
}
using System;
namespace ReflectedProperty
{
public class Activity
{
public Activity() { }
private Employee[] _employee;
public Employee[] Employee
{
get { return this._employee; }
set { this._employee = value; }
}
}
}
using System;
using System.Reflection;
using System.Windows.Forms;
namespace ReflectedProperty
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Activity activity = new Activity();
foreach (PropertyInfo info in activity.GetType().GetProperties())
{
MessageBox.Show(info.PropertyType.BaseType.Name);
}
}
}
}
Not at all what I’d expect, though I guess it (kind of) makes sense. Anyone have an answer how to code around this one?
Posted
Aug 07 2005, 11:23 AM
by
Jayson Knight