mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +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>
|
public class GenericEventArgs<T> : EventArgs, IGenericEventArgs<T>
|
||||||
{
|
{
|
||||||
|
private readonly T m_Data;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the wrapped data associated with the event.
|
/// Gets the wrapped data associated with the event.
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
@@ -15,7 +22,7 @@ namespace ICD.Common.Utils.EventArguments
|
|||||||
/// <param name="data"></param>
|
/// <param name="data"></param>
|
||||||
public GenericEventArgs(T data)
|
public GenericEventArgs(T data)
|
||||||
{
|
{
|
||||||
Data = data;
|
m_Data = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
namespace ICD.Common.Utils.EventArguments
|
namespace ICD.Common.Utils.EventArguments
|
||||||
{
|
{
|
||||||
public interface IGenericEventArgs<T>
|
public interface IGenericEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the wrapped data associated with the event.
|
/// Gets the wrapped data associated with the event.
|
||||||
/// </summary>
|
/// </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