40 lines
885 B
C#
40 lines
885 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Hncore.Infrastructure.Events
|
|
{
|
|
/// <summary>
|
|
/// 事件源:描述事件信息,用于参数传递
|
|
/// </summary>
|
|
public class EventData<TData> : IEventData where TData:class
|
|
{
|
|
/// <summary>
|
|
/// 事件发生的时间
|
|
/// </summary>
|
|
public DateTime EventTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 触发事件的对象
|
|
/// </summary>
|
|
public TData EventSource { get; set; }
|
|
|
|
object IEventData.EventSource
|
|
{
|
|
get
|
|
{
|
|
return this.EventSource as TData;
|
|
}
|
|
|
|
set { this.EventSource =(TData) value; }
|
|
}
|
|
|
|
public EventData()
|
|
{
|
|
EventTime = DateTime.Now;
|
|
}
|
|
}
|
|
}
|