Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ GetDataForComInvocation()

static void System.Runtime.InteropServices.ComAwareEventInfo.GetDataForComInvocation ( EventInfo eventInfo,
out Guid sourceIid,
out int dispid )
inlinestaticprivate

Definition at line 97 of file ComAwareEventInfo.cs.

98 {
99 object[] customAttributes = eventInfo.DeclaringType.GetCustomAttributes(typeof(ComEventInterfaceAttribute), inherit: false);
100 if (customAttributes == null || customAttributes.Length == 0)
101 {
103 }
104 if (customAttributes.Length > 1)
105 {
107 }
108 Type sourceInterface = ((ComEventInterfaceAttribute)customAttributes[0]).SourceInterface;
110 MethodInfo method = sourceInterface.GetMethod(eventInfo.Name);
111 Attribute customAttribute = Attribute.GetCustomAttribute(method, typeof(DispIdAttribute));
112 if (customAttribute == null)
113 {
115 }
116 sourceIid = gUID;
117 dispid = ((DispIdAttribute)customAttribute).Value;
118 }
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

References System.SR.AmbiguousMatch_MultipleEventInterfaceAttributes, System.Attribute.GetCustomAttribute(), System.SR.InvalidOperation_NoComEventInterfaceAttribute, and System.SR.InvalidOperation_NoDispIdAttribute.

Referenced by System.Runtime.InteropServices.ComAwareEventInfo.AddEventHandler(), and System.Runtime.InteropServices.ComAwareEventInfo.RemoveEventHandler().