Hi there,
I’m seeing a False-Positive of rule csharpsquid:S3264 - it complains that an event is not invoked.
The specialty is that the event is invoked using the GetInvocationList
followed by a BeginInvoke
The respective code looks as follows
private void RaiseEventAsync(LoggingEvent loggingEvent)
{
if (MessageLogged != null)
{
var eventListeners = MessageLogged.GetInvocationList();
foreach (var eventListener in eventListeners)
{
var methodToInvoke = (MessageLoggedEventHandler)eventListener;
methodToInvoke.BeginInvoke(this, new LoggingEventArgs(loggingEvent.Level, loggingEvent.RenderedMessage), EndAsyncEvent, null);
}
}
}
I’m not sure if the rule can be amended to not trigger in such a situation.
Best regards
Norbert