Typically, a property has get_ and set_ accessors, and an event has add_ and remove_ accessors. C++/CLI additionally supports a raise_ accessor for events (ECMA-372 1st ed. §19.6.2 "Accessor functions").
The Common Language Infrastructure also allows properties and events to have accessors with "other" method semantics (ECMA-335 4th ed. §II.17 "Defining properties", §II.18 "Defining events", §II.23.1.12 "Flags for MethodSemantics [MethodSemanticsAttributes]"). Does some compiler use those for interesting purposes?
I imagine "other" accessors of events could be used for:
- A variant of remove_ that blocks until other threads have finished executing the event handler that is being removed.
- A variant of raise_ that gets Task objects from all event handlers and combines them with Task.WhenAll.
- An accessor that returns a Boolean value indicating whether the event has any handlers.
I imagine "other" accessors of properties could be used for:
- Interlocked operations on a backing field.
- Asking how the value of the property was set.
- Replacing the ShouldSerializeXXX naming convention used by XmlSerializer.
- Replacing the ShouldSerializeXXX, ResetXXX, GetXXX, and SetXXX naming conventions used with ProvidePropertyAttribute.PropertyName. (Although ECMA-335 4th ed. §II.22.28 "MethodSemantics : 0x18" says it is an ERROR if a property or event in one class has an accessor method defined in a different class, this rule is only informative, presumably because the Virtual Execution System doesn't need to care. The normative text in §II.17 "Defining properties" allows such extender properties in ILAsm.)
The semantics of those accessors would then not be apparent from the MethodSemantics table, but they could be encoded in the names of the methods (if the specialname bit is set) or in custom attributes.
It looks like PropertyInfo.GetAccessors and EventInfo.GetOtherMethods in the class library already support "other" accessors. (I am surprised that there is no PropertyInfo.GetOtherMethods or EventInfo.GetAccessors.)