public EventInfo(EventInfo eventDef, TypeInfo declaringType) : base(declaringType) { rootDefinition = eventDef; Name = eventDef.Name; Attributes = eventDef.Attributes; eventTypeReference = TypeRef.FromTypeInfo(eventDef.EventHandlerType.SubstituteGenericArguments(declaringType.GetGenericArguments())); AddMethod = declaringType.GetMethodByDefinition(eventDef.AddMethod); RemoveMethod = declaringType.GetMethodByDefinition(eventDef.RemoveMethod); RaiseMethod = declaringType.GetMethodByDefinition(eventDef.RaiseMethod); }
public PropertyInfo(PropertyInfo propertyDef, TypeInfo declaringType) : base(declaringType) { rootDefinition = propertyDef; Name = propertyDef.Name; if (propertyDef.GetMethod != null) { GetMethod = declaringType.GetMethodByDefinition(propertyDef.GetMethod); } if (propertyDef.SetMethod != null) { SetMethod = declaringType.GetMethodByDefinition(propertyDef.SetMethod); } }