初步添加事件服务
This commit is contained in:
58
DMS.WPF/Interfaces/IEventService.cs
Normal file
58
DMS.WPF/Interfaces/IEventService.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using DMS.WPF.Events;
|
||||
|
||||
namespace DMS.WPF.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// 事件服务接口,用于统一管理应用程序中的各种事件
|
||||
/// </summary>
|
||||
public interface IEventService
|
||||
{
|
||||
#region 设备事件
|
||||
|
||||
/// <summary>
|
||||
/// 设备状态改变事件
|
||||
/// </summary>
|
||||
event EventHandler<DeviceActiveChangedEventArgs> DeviceStatusChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 触发设备状态改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">设备状态改变事件参数</param>
|
||||
void RaiseDeviceStatusChanged(object sender, DeviceActiveChangedEventArgs e);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 变量事件
|
||||
|
||||
/// <summary>
|
||||
/// 变量值改变事件
|
||||
/// </summary>
|
||||
event EventHandler<VariableValueChangedEventArgs> VariableValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 触发变量值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">变量值改变事件参数</param>
|
||||
void RaiseVariableValueChanged(object sender, VariableValueChangedEventArgs e);
|
||||
|
||||
#endregion
|
||||
|
||||
#region MQTT事件
|
||||
|
||||
/// <summary>
|
||||
/// MQTT连接状态改变事件
|
||||
/// </summary>
|
||||
event EventHandler<MqttConnectionChangedEventArgs> MqttConnectionChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 触发MQTT连接状态改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">MQTT连接状态改变事件参数</param>
|
||||
void RaiseMqttConnectionChanged(object sender, MqttConnectionChangedEventArgs e);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
using DMS.WPF.Interfaces;
|
||||
|
||||
namespace DMS.WPF.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
@@ -33,5 +35,10 @@ public interface IWPFDataService
|
||||
/// 日志数据服务。
|
||||
/// </summary>
|
||||
ILogDataService LogDataService { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 事件服务。
|
||||
/// </summary>
|
||||
IEventService EventService { get; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user