Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
            }
        }