mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
feat: Adding simple IGenericEventArgs interface
This commit is contained in:
@@ -4,10 +4,17 @@ namespace ICD.Common.Utils.EventArguments
|
||||
{
|
||||
public class GenericEventArgs<T> : EventArgs, IGenericEventArgs<T>
|
||||
{
|
||||
private readonly T m_Data;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the wrapped data associated with the event.
|
||||
/// </summary>
|
||||
public T Data { get; private set; }
|
||||
object IGenericEventArgs.Data { get { return Data; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the wrapped data associated with the event.
|
||||
/// </summary>
|
||||
public T Data { get { return m_Data; } }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
@@ -15,7 +22,7 @@ namespace ICD.Common.Utils.EventArguments
|
||||
/// <param name="data"></param>
|
||||
public GenericEventArgs(T data)
|
||||
{
|
||||
Data = data;
|
||||
m_Data = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
namespace ICD.Common.Utils.EventArguments
|
||||
{
|
||||
public interface IGenericEventArgs<T>
|
||||
public interface IGenericEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the wrapped data associated with the event.
|
||||
/// </summary>
|
||||
T Data { get; }
|
||||
object Data { get; }
|
||||
}
|
||||
|
||||
public interface IGenericEventArgs<T> : IGenericEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the wrapped data associated with the event.
|
||||
/// </summary>
|
||||
new T Data { get; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user