PropertyDescriptorCollection GetEventProperties(EventDescriptorCollection events) { if (events == null) { throw new ArgumentNullException("events"); } List <PropertyDescriptor> list = new List <PropertyDescriptor>(events.Count); if (this._eventProperties == null) { this._eventProperties = new Hashtable(); } for (int i = 0; i < events.Count; i++) { if (!this.HasGenericArgument(events[i])) { object eventDescriptorHashCode = this.GetEventDescriptorHashCode(events[i]); PropertyDescriptor item = (PropertyDescriptor)this._eventProperties[eventDescriptorHashCode]; if (item == null) { item = new EventPropertyDescriptor(events[i]); this._eventProperties[eventDescriptorHashCode] = item; } list.Add(item); } } return(new PropertyDescriptorCollection(list.ToArray())); }
// Methods public ReferenceEventClosure(object reference, EventPropertyDescriptor prop) { this.reference = reference; this.propertyDescriptor = prop; }