1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00
RGB.NET/RGB.NET.Core/Update/AbstractUpdateTrigger.cs

39 lines
1.2 KiB
C#

using System;
namespace RGB.NET.Core
{
/// <summary>
/// Represents a generic update trigger.
/// </summary>
public abstract class AbstractUpdateTrigger : AbstractBindable, IUpdateTrigger
{
#region Events
/// <inheritdoc />
public event EventHandler<CustomUpdateData> Starting;
/// <inheritdoc />
public event EventHandler<CustomUpdateData> Update;
#endregion
#region Methods
/// <summary>
/// Invokes the <see cref="Starting"/>-event.
/// </summary>
/// <param name="updateData">Optional custom-data passed to the subscribers of the <see cref="Starting"/>.event.</param>
protected virtual void OnStartup(CustomUpdateData updateData = null) => Starting?.Invoke(this, updateData);
/// <summary>
/// Invokes the <see cref="Update"/>-event.
/// </summary>
/// <param name="updateData">Optional custom-data passed to the subscribers of the <see cref="Update"/>.event.</param>
protected virtual void OnUpdate(CustomUpdateData updateData = null) => Update?.Invoke(this, updateData);
/// <inheritdoc />
public abstract void Dispose();
#endregion
}
}