/// <summary> /// Raises the <see cref="NewMeasurements"/> event. /// </summary> /// <param name="measurements">New measurements.</param> protected virtual void OnNewMeasurements(ICollection <IMeasurement> measurements) { try { NewMeasurements?.Invoke(this, new EventArgs <ICollection <IMeasurement> >(measurements)); } catch (Exception ex) { // We protect our code from consumer thrown exceptions OnProcessException(MessageLevel.Info, new InvalidOperationException($"Exception in consumer handler for NewMeasurements event: {ex.Message}", ex), "ConsumerEventException"); } }
// Raise new measurements event on behalf of each item in collection private void item_NewMeasurements(object sender, EventArgs <ICollection <IMeasurement> > e) => NewMeasurements?.Invoke(sender, e);