Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AddEventHandler() [2/2]

virtual void System.Reflection.EventInfo.AddEventHandler ( object? target,
Delegate? handler )
inlinevirtualinherited

Definition at line 82 of file EventInfo.cs.

83 {
84 MethodInfo addMethod = GetAddMethod(nonPublic: false);
85 if (addMethod == null)
86 {
87 throw new InvalidOperationException(SR.InvalidOperation_NoPublicAddMethod);
88 }
89 addMethod.Invoke(target, new object[1] { handler });
90 }
MethodInfo? GetAddMethod()
Definition EventInfo.cs:59

References System.Reflection.EventInfo.GetAddMethod(), System.SR.InvalidOperation_NoPublicAddMethod, and System.Reflection.MethodBase.Invoke().

Referenced by System.Runtime.InteropServices.ComAwareEventInfo.AddEventHandler().