Can anyone help me with this one, I'm all out of ideas :(
I have a custom Component deriving from Component. This component also implements the IListSource interface.
The most important method I have to implement for this is GetList();
In the GetList method I need to obtain the parents type where my component is placed on. In this case a standard form derived from System.Windows.Forms.Form.
I tried to do the following:
IDesignerHost host = Site.Container as System.ComponentModel.Design.IDesignerHost;
With the host I have now, I can get the RootComponent, BUT, and now comes the problem, the RootComponent is at that time the baseclass of the actual parent object. So I get System.Windows.Forms.Form instead of my derived parent class' type.
I've discovered that this is because the designerhost is at that moment still in the loading state. The problem is that the GetList() is called before the loading state finishes and by the time the host is fully loaded, it it already too late, GetList isn't called again.
Can anyone help me with this ?
I'll be worshipping you until the end of my days ;) customcomponent.cs