You need to change this code:
private void Bar()
{
OnBuildStart(new BuildStartEventArgs());
}
like that:
private void Bar()
{
var e = new BuildStartEventArgs();
OnBuildStart(e);
if (!e.Cancel) {
}
}
Classes in .NET have referential semantics, so you can see any changes made to the object, the event reference parameter.
source
share