コード例 #1
0
        public EventPropertyDescriptor(object component, EventInfo eventInfo, EventHandlerList eventHandlerList)
            : base(eventInfo.Name)
        {
            this.component        = component;
            this.eventInfo        = eventInfo;
            this.eventHandlerList = eventHandlerList;

            this.converter = new EventInfoConverter(this);
        }
コード例 #2
0
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object component, Attribute[] attributes)
        {
            EventInfoConverter eventConverter = component as EventInfoConverter;

            if (eventConverter != null)
            {
                return(eventConverter.GetProperties());
            }
            else
            {
                return(PropertyDescriptorUtils.GetInstanceEvents(component));
            }
        }