- 创建了 ActionChangeType 枚举(与 DataChangeType 相同)
- 创建了 VariablePropertyType 枚举标识变量属性类型
- 重构 VariableChangedEventArgs 类,移除 ChangeTime 和 VariableTable 属性
- 将 ChangeType 从 DataChangeType 改为 ActionChangeType
- 添加了 PropertyType 属性用于标识哪个属性发生变化
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using DMS.Application.DTOs;
|
|
using DMS.Core.Enums;
|
|
|
|
namespace DMS.Application.Events
|
|
{
|
|
/// <summary>
|
|
/// 变量变更事件参数
|
|
/// </summary>
|
|
public class VariableChangedEventArgs : System.EventArgs
|
|
{
|
|
/// <summary>
|
|
/// 变更类型
|
|
/// </summary>
|
|
public ActionChangeType ChangeType { get; }
|
|
|
|
/// <summary>
|
|
/// 变量DTO
|
|
/// </summary>
|
|
public VariableDto Variable { get; }
|
|
|
|
/// <summary>
|
|
/// 发生变化的属性类型
|
|
/// </summary>
|
|
public VariablePropertyType PropertyType { get; }
|
|
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
/// <param name="changeType">变更类型</param>
|
|
/// <param name="variable">变量DTO</param>
|
|
/// <param name="propertyType">发生变化的属性类型</param>
|
|
public VariableChangedEventArgs(ActionChangeType changeType, VariableDto variable, VariablePropertyType propertyType = VariablePropertyType.All)
|
|
{
|
|
ChangeType = changeType;
|
|
Variable = variable;
|
|
PropertyType = propertyType;
|
|
}
|
|
}
|
|
} |