- 修改 VariableValueChangedEventArgs 类:
- 移除了 VariableId、VariableName、NewValue 和 UpdateTime 属性
- 添加了 Variable(VariableDto 类型)和 OldValue 属性
- 更新了构造函数以接收 VariableDto 对象和旧值
- 更新事件触发代码:
- 修改了 UpdateViewProcessor.cs 中的事件触发代码,改为传递 VariableDto 对象和旧值
- 更新事件处理代码:
- 修改了 DataEventService.cs 中的事件处理逻辑,改为访问 e.Variable 属性
- 修改了 VariableHistoryViewModel.cs 中的事件处理逻辑,改为使用 e.Variable 属性
29 lines
685 B
C#
29 lines
685 B
C#
using DMS.Application.DTOs;
|
|
|
|
namespace DMS.Application.Events
|
|
{
|
|
/// <summary>
|
|
/// 变量值变更事件参数
|
|
/// </summary>
|
|
public class VariableValueChangedEventArgs : EventArgs
|
|
{
|
|
/// <summary>
|
|
/// 变量DTO对象
|
|
/// </summary>
|
|
public VariableDto Variable { get; set; }
|
|
|
|
/// <summary>
|
|
/// 旧值
|
|
/// </summary>
|
|
public string? OldValue { get; set; }
|
|
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
public VariableValueChangedEventArgs(VariableDto variable, string? oldValue)
|
|
{
|
|
Variable = variable;
|
|
OldValue = oldValue;
|
|
}
|
|
}
|
|
} |