Ejemplo n.º 1
0
 public override void SetValue(object component, object value)
 {
     if (component is IComponent)
     {
         this.realPropertyDescriptor.SetValue(component, value);
     }
     else
     {
         PropertyDescriptorUtils.SetPropertyValue(ServiceProvider, this.realPropertyDescriptor, component, value);
     }
 }
Ejemplo n.º 2
0
        public override void SetValue(object component, object value)
        {
            if (component == null)
            {
                throw new ArgumentNullException("component");
            }

            if (value != null)
            {
                Type type = value as Type;
                ITypeFilterProvider filterProvider = PropertyDescriptorUtils.GetComponent(new TypeDescriptorContext(ServiceProvider, RealPropertyDescriptor, component)) as ITypeFilterProvider;
                if (filterProvider != null)
                {
                    filterProvider.CanFilterType(type, true); //this will throw an exception if the type is not correctly filterable
                }
            }

            base.SetValue(component, value);
        }