ICollection IComponentDiscoveryService.GetComponentTypes(IDesignerHost designerHost, System.Type baseType) { Hashtable hashtable = new Hashtable(); ToolboxItemCollection toolboxItems = ((IToolboxService)this).GetToolboxItems(); if (toolboxItems != null) { System.Type type = typeof(IComponent); TypeDescriptionProviderService service = null; TypeDescriptionProvider provider = null; if (designerHost != null) { service = designerHost.GetService(typeof(TypeDescriptionProviderService)) as TypeDescriptionProviderService; } foreach (ToolboxItem item in toolboxItems) { System.Type c = item.GetType(designerHost); if (((c != null) && type.IsAssignableFrom(c)) && ((baseType == null) || baseType.IsAssignableFrom(c))) { if (service != null) { provider = service.GetProvider(c); if ((provider != null) && !provider.IsSupportedType(c)) { continue; } } hashtable[c] = c; } } } return(hashtable.Values); }
void AddTargetFrameworkProvider(IComponent component) { TypeDescriptionProviderService typeDescriptionProviderService = GetService(typeof(TypeDescriptionProviderService)) as TypeDescriptionProviderService; if (typeDescriptionProviderService != null && component != null) { TypeDescriptor.AddProvider(typeDescriptionProviderService.GetProvider(component), component); } }
private void AddTargetFrameworkProvider(IComponent component) { TypeDescriptionProviderService service = base.GetService(typeof(TypeDescriptionProviderService)) as TypeDescriptionProviderService; if ((service != null) && (component != null)) { TypeDescriptor.AddProvider(service.GetProvider(component), component); } }
private static TypeDescriptionProvider GetTargetFrameworkProvider(Type type) { TypeDescriptionProviderService service = TargetFrameworkUtil.TypeDescriptionProviderService; if (service != null) { return(service.GetProvider(type)); } return(null); }
protected virtual Type GetType(string typeName) { Type runtimeType = this.GetRuntimeType(typeName); if (runtimeType != null) { TypeDescriptionProviderService service = this.GetService(typeof(TypeDescriptionProviderService)) as TypeDescriptionProviderService; if ((service != null) && !service.GetProvider(runtimeType).IsSupportedType(runtimeType)) { runtimeType = null; } } return(runtimeType); }
private TypeDescriptionProvider GetTargetFrameworkProviderForType(Type type) { if (m_manager == null) { return(null); } TypeDescriptionProviderService service = m_manager.GetService(typeof(TypeDescriptionProviderService)) as TypeDescriptionProviderService; if (service == null) { return(null); } return(service.GetProvider(type)); }