Consider rewriting this:
if (this.ErrorOccurred != null)
{
this.ErrorOccurred(this, e);
}
Into:
var handler = ErrorOccurred;
if (handler != null)
{
handler(this, e);
}
if (this.ErrorOccurred != null)
{
this.ErrorOccurred(this, e);
}
Into:
var handler = ErrorOccurred;
if (handler != null)
{
handler(this, e);
}