1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//! Owned Event table representation.
//!
//! This module provides the [`crate::metadata::tables::event::owned::Event`] struct
//! which contains fully resolved event metadata with owned data and resolved references.
//! This is the primary data structure for representing .NET event definitions in a usable
//! form after the dual variant resolution phase.
use OnceLock;
use crate;
/// Represents a .NET CIL event with fully resolved metadata and owned data
///
/// This structure contains complete event information from the Event metadata table (0x14),
/// with all heap references resolved to owned strings and type references. Unlike
/// [`crate::metadata::tables::event::raw::EventRaw`], this provides immediate access to
/// event data without requiring heap lookups or coded index resolution.
///
/// # .NET Event Model
///
/// Events in .NET provide a standardized notification mechanism with these characteristics:
/// - **Type Safety**: Event handler type is enforced at compile time
/// - **Multicast Support**: Multiple subscribers can attach to a single event
/// - **Standard Accessors**: Add/remove methods with optional raise and other operations
/// - **Observer Pattern**: Clean separation between event source and subscribers
///
/// # Event Accessor Methods
///
/// Events are associated with accessor methods that implement the event semantics:
/// - **Add**: Subscribe a handler to the event (required)
/// - **Remove**: Unsubscribe a handler from the event (required)
/// - **Raise**: Trigger the event (optional, often fire_ or on_ prefixed)
/// - **Other**: Additional custom operations (optional)
///
/// # Reference
/// - [ECMA-335 II.22.13](https://ecma-international.org/wp-content/uploads/ECMA-335_6th_edition_june_2012.pdf) - Event table specification