/// <summary> /// Perform temperature-dependent calculations. /// </summary> protected void Temperature() { var args = new TemperatureStateEventArgs(_temperature); OnBeforeTemperature(args); foreach (var behavior in _temperatureBehaviors) { behavior.Temperature(); } OnAfterTemperature(args); }
/// <summary> /// Raises the <see cref="AfterTemperature" /> event. /// </summary> /// <param name="args">The <see cref="TemperatureStateEventArgs"/> instance containing the event data.</param> protected virtual void OnAfterTemperature(TemperatureStateEventArgs args) => AfterTemperature?.Invoke(this, args);
/// <summary> /// Raises the <see cref="BeforeTemperature" /> event. /// </summary> /// <param name="args">The <see cref="TemperatureStateEventArgs"/> instance containing the event data.</param> protected virtual void OnBeforeTemperature(TemperatureStateEventArgs args) => BeforeTemperature?.Invoke(this, args);