mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-02 19:37:43 +00:00
d7dbd7078a
- 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.
23 lines
504 B
C#
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;
|
|
}
|