Define interface for loading custom UserControls through reflection
- by Tim
I'm loading custom user controls into my form using reflection.
I would like all my user controls to have a "Start" and "End" method so they should all be like:
public interface IStartEnd
{
void Start();
void End();
}
public class AnotherControl : UserControl, IStartEnd
{
public void Start()
{ }
public void End()
{ }
}
I would like an interface to load through reflection, but the following obviously wont work as an interface cannot inherit a class:
public interface IMyUserControls : UserControl, IInit, IDispose
{
}