Ejemplo n.º 1
0
        public IProxyEventInfo GetEvent(string name)
        {
            IProxyEventInfo info;

            if (this.events.TryGetValue(name, out info))
            {
                return(info);
            }

            EventInfo eventInfo = this.type.GetEvent(name);

            if (eventInfo != null && eventInfo.DeclaringType.Equals(type))
            {
                return(this.CreateProxyEventInfo(eventInfo));
            }

            IProxyType baseTypeInfo = this.GetBase();

            if (baseTypeInfo == null)
            {
                return(null);
            }

            return(baseTypeInfo.GetEvent(name));
        }
 public static IProxyEventInfo AsProxy(this EventInfo info)
 {
     IProxyType proxyType = factory.Get(info.DeclaringType);
     return proxyType.GetEvent(info.Name);
 }