internal void CheckHandled()
{
Debug.WriteLine("The event arguments {0} were handled by {1} handlers", this.GetType().FullName, this.handled);
Debug.Assert(this.handled > 0, "Caught unhandled event which was supposed to be handled", "Arguments type: {0}", this.GetType().FullName);
}
}
private void OnStarted() { this.IsStarted = true; this.ThreadSafeCreateCancellationTokenSource(); VsThreadingHelper.RunInline(this, VsTaskRunContext.UIThreadNormalPriority, () => { ConfigureStepEventListeners(true); var delegates = this.StartedPrivate; if (delegates != null) { ProgressEventArgs args = new ProgressEventArgs(); delegates(this, args); // Verify that the observer handled it since now easy way of testing // serialized raising and handling of the event across the classes args.CheckHandled(); } }); }