Files
QuanTAlib/lib/core/tseries/ITValuePublisher.cs
T
Miha Kralj d7dbd7078a Refactor event handling and improve argument validation across indicators
- Updated event handler signatures to use TValueEventArgs for consistency in Mama, Mgdi, Pwma, Rma, Sma, Ssf, Super, T3, Tema, Trima, Usf, Vidya, Wma, and Atr classes.
- Enhanced argument validation by specifying parameter names in exceptions for clarity.
- Adjusted tests to align with new event handler signatures.
- Improved code readability and maintainability by using structured records and lambda expressions.
2025-12-27 15:46:28 -08:00

23 lines
504 B
C#

using System;
namespace QuanTAlib;
public sealed class TValueEventArgs : EventArgs
{
public TValue Value { get; init; }
public bool IsNew { get; init; }
}
public delegate void TValuePublishedHandler(object? sender, TValueEventArgs args);
/// <summary>
/// Interface for objects that publish TValue updates.
/// </summary>
public interface ITValuePublisher
{
/// <summary>
/// Event triggered when a new TValue is available.
/// </summary>
event TValuePublishedHandler? Pub;
}