protected static object GetInvokee(Type componentClass, object component) { if (component is IComponent) { ISite site = ((IComponent)component).Site; if (site != null && site.DesignMode) { System.ComponentModel.Design.IDesignerHost designerHost = site.GetService(typeof(System.ComponentModel.Design.IDesignerHost)) as System.ComponentModel.Design.IDesignerHost; if (designerHost != null) { System.ComponentModel.Design.IDesigner designer = designerHost.GetDesigner((IComponent)component); if (designer != null && componentClass.IsInstanceOfType(designer)) { component = designer; } } } } return(component); }
public override bool CanBeParentedTo(System.ComponentModel.Design.IDesigner parentDesigner) { return(false); }
public override bool CanBeParentedTo(System.ComponentModel.Design.IDesigner parentDesigner) { return((parentDesigner != null) && parentDesigner.Component is StatusContainer); }