mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-22 11:33:07 +08:00
51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
// ------------------------------------------------------------------------
|
||
// 版权信息
|
||
// 版权归百小僧及百签科技(广东)有限公司所有。
|
||
// 所有权利保留。
|
||
// 官方网站:https://baiqian.com
|
||
//
|
||
// 许可证信息
|
||
// 项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。
|
||
// 许可证的完整文本可以在源代码树根目录中的 LICENSE-APACHE 和 LICENSE-MIT 文件中找到。
|
||
// ------------------------------------------------------------------------
|
||
|
||
namespace ThingsGateway.EventBus;
|
||
|
||
/// <summary>
|
||
/// 事件处理程序事件参数
|
||
/// </summary>
|
||
[SuppressSniffer]
|
||
public sealed class EventHandlerEventArgs : EventArgs
|
||
{
|
||
/// <summary>
|
||
/// 构造函数
|
||
/// </summary>
|
||
/// <param name="eventSource">事件源(事件承载对象)</param>
|
||
/// <param name="success">任务处理委托调用结果</param>
|
||
public EventHandlerEventArgs(IEventSource eventSource, bool success)
|
||
{
|
||
Source = eventSource;
|
||
Status = success ? "SUCCESS" : "FAIL";
|
||
}
|
||
|
||
/// <summary>
|
||
/// 事件源(事件承载对象)
|
||
/// </summary>
|
||
public IEventSource Source { get; }
|
||
|
||
/// <summary>
|
||
/// 执行状态
|
||
/// </summary>
|
||
public string Status { get; }
|
||
|
||
/// <summary>
|
||
/// 异常信息
|
||
/// </summary>
|
||
public Exception Exception { get; internal set; }
|
||
|
||
|
||
/// <summary>
|
||
/// 执行结果
|
||
/// </summary>
|
||
public object Result { get; internal set; }
|
||
} |