示例#1
0
 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);
 }
示例#3
0
 public override bool CanBeParentedTo(System.ComponentModel.Design.IDesigner parentDesigner)
 {
     return((parentDesigner != null) && parentDesigner.Component is StatusContainer);
 }