public interface ITest {
void Somethink();
}
public class Test1 : ITest {
public void Somethink() { /* do stuff */ }
public int Test1Property { get; set; }
}
public class Test2 : ITest {
public void Somethink() { /* do stuff */ }
public float Test2Property { get; set; }
}
//Main class
public class MainClass
{
[TypeConverter(ExpandableObjectConverter)]
public ITest test { get; set; }
}
Ok, i have sth like this. Instance of MainClass is selected by PropertyGrid.
How to make a DropDownList of objects of classes which implement ITest (here Test1 and Test2)