Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ComAwareEventInfo.cs
Go to the documentation of this file.
5
7
9{
10 private readonly EventInfo _innerEventInfo;
11
13
15
17
18 public override Module Module => _innerEventInfo.Module;
19
20 public override string Name => _innerEventInfo.Name;
21
23
25 {
26 _innerEventInfo = type.GetEvent(eventName);
27 }
28
29 [SupportedOSPlatform("windows")]
30 public override void AddEventHandler(object target, Delegate handler)
31 {
32 if (Marshal.IsComObject(target))
33 {
35 ComEventsHelper.Combine(target, sourceIid, dispid, handler);
36 }
37 else
38 {
39 _innerEventInfo.AddEventHandler(target, handler);
40 }
41 }
42
43 [SupportedOSPlatform("windows")]
44 public override void RemoveEventHandler(object target, Delegate handler)
45 {
46 if (Marshal.IsComObject(target))
47 {
49 ComEventsHelper.Remove(target, sourceIid, dispid, handler);
50 }
51 else
52 {
53 _innerEventInfo.RemoveEventHandler(target, handler);
54 }
55 }
56
57 public override MethodInfo? GetAddMethod(bool nonPublic)
58 {
60 }
61
62 public override MethodInfo[] GetOtherMethods(bool nonPublic)
63 {
65 }
66
67 public override MethodInfo? GetRaiseMethod(bool nonPublic)
68 {
70 }
71
72 public override MethodInfo? GetRemoveMethod(bool nonPublic)
73 {
75 }
76
77 public override object[] GetCustomAttributes(Type attributeType, bool inherit)
78 {
79 return _innerEventInfo.GetCustomAttributes(attributeType, inherit);
80 }
81
82 public override object[] GetCustomAttributes(bool inherit)
83 {
85 }
86
91
92 public override bool IsDefined(Type attributeType, bool inherit)
93 {
94 return _innerEventInfo.IsDefined(attributeType, inherit);
95 }
96
119}
static ? Attribute GetCustomAttribute(MemberInfo element, Type attributeType)
Definition Attribute.cs:411
MethodInfo? GetAddMethod()
Definition EventInfo.cs:59
virtual void AddEventHandler(object? target, Delegate? handler)
Definition EventInfo.cs:82
MethodInfo? GetRaiseMethod()
Definition EventInfo.cs:69
MethodInfo[] GetOtherMethods()
Definition EventInfo.cs:49
EventAttributes Attributes
Definition EventInfo.cs:10
MethodInfo? GetRemoveMethod()
Definition EventInfo.cs:64
virtual void RemoveEventHandler(object? target, Delegate? handler)
Definition EventInfo.cs:94
bool IsDefined(Type attributeType, bool inherit)
virtual IList< CustomAttributeData > GetCustomAttributesData()
Definition MemberInfo.cs:77
object[] GetCustomAttributes(bool inherit)
override void RemoveEventHandler(object target, Delegate handler)
override? MethodInfo GetRemoveMethod(bool nonPublic)
override? MethodInfo GetAddMethod(bool nonPublic)
override object[] GetCustomAttributes(Type attributeType, bool inherit)
override IList< CustomAttributeData > GetCustomAttributesData()
override MethodInfo[] GetOtherMethods(bool nonPublic)
static void GetDataForComInvocation(EventInfo eventInfo, out Guid sourceIid, out int dispid)
override? MethodInfo GetRaiseMethod(bool nonPublic)
override object[] GetCustomAttributes(bool inherit)
override bool IsDefined(Type attributeType, bool inherit)
override void AddEventHandler(object target, Delegate handler)
ComAwareEventInfo([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents)] Type type, string eventName)
static ? Delegate Remove(object rcw, Guid iid, int dispid, Delegate d)
static void Combine(object rcw, Guid iid, int dispid, Delegate d)
static bool IsComObject(object o)
Definition Marshal.cs:353
static string AmbiguousMatch_MultipleEventInterfaceAttributes
Definition SR.cs:22
static string InvalidOperation_NoDispIdAttribute
Definition SR.cs:24
static string InvalidOperation_NoComEventInterfaceAttribute
Definition SR.cs:20
Definition SR.cs:7