internal CILEventImpl( CILReflectionContextImpl ctx, Int32 anID, System.Reflection.EventInfo evt) : base(ctx, anID, CILElementKind.Event, () => new CustomAttributeDataEventArgs(ctx, evt)) { ArgumentValidator.ValidateNotNull("Event", evt); if (evt.DeclaringType #if WINDOWS_PHONE_APP .GetTypeInfo() #endif .IsGenericType&& !evt.DeclaringType #if WINDOWS_PHONE_APP .GetTypeInfo() #endif .IsGenericTypeDefinition) { throw new ArgumentException("This constructor may be used only on events declared in genericless types or generic type definitions."); } InitFields( ref this.name, ref this.eventAttributes, ref this.eventType, ref this.addMethod, ref this.removeMethod, ref this.raiseMethod, ref this.otherMethods, ref this.declaringType, new SettableValueForClasses <String>(evt.Name), new SettableValueForEnums <EventAttributes>((EventAttributes)evt.Attributes), () => ctx.Cache.GetOrAdd(evt.EventHandlerType), () => ctx.Cache.GetOrAdd(evt.GetAddMethod(true)), () => ctx.Cache.GetOrAdd(evt.GetRemoveMethod(true)), () => ctx.Cache.GetOrAdd(evt.GetRaiseMethod(true)), () => ctx.CollectionsFactory.NewListProxy <CILMethod>(ctx.LaunchEventOtherMethodsLoadEvent(new EventOtherMethodsEventArgs(evt)).Select(method => ctx.Cache.GetOrAdd(method)).ToList()), () => (CILType)ctx.Cache.GetOrAdd(evt.DeclaringType), true ); }
private System.Reflection.MethodInfo GetRaiseEventMethodInfo(string EventName) { Type ctlType = typeof(T); System.Reflection.EventInfo eveInfo = ctlType.GetEvent(EventName); System.Reflection.MethodInfo raiseMethod = null; if (eveInfo == null) { throw new NotImplementedException(string.Format("Event {0} has not been implemented.", EventName)); } else { raiseMethod = eveInfo.GetRaiseMethod(true); if (raiseMethod == null) { raiseMethod = ctlType.GetMethod(string.Format("On{0}", EventName), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic); if (raiseMethod == null) { throw new NotImplementedException(string.Format("Raising method of event {0} has not been implemented.", EventName)); } } } return(raiseMethod); }
public IMethod GetRaiseMethod() { return((IMethod)_typeSystemServices.Map(_event.GetRaiseMethod())); }
public override System.Reflection.MethodInfo GetRaiseMethod(bool nonPublic) { return(_innerEventInfo.GetRaiseMethod(nonPublic)); }
public virtual IMethod GetRaiseMethod() { return((IMethod)_typeSystemServices.Map(_event.GetRaiseMethod(true))); }