重构:修改 VariableValueChangedEventArgs 以包含 VariableDto 对象
- 修改 VariableValueChangedEventArgs 类:
- 移除了 VariableId、VariableName、NewValue 和 UpdateTime 属性
- 添加了 Variable(VariableDto 类型)和 OldValue 属性
- 更新了构造函数以接收 VariableDto 对象和旧值
- 更新事件触发代码:
- 修改了 UpdateViewProcessor.cs 中的事件触发代码,改为传递 VariableDto 对象和旧值
- 更新事件处理代码:
- 修改了 DataEventService.cs 中的事件处理逻辑,改为访问 e.Variable 属性
- 修改了 VariableHistoryViewModel.cs 中的事件处理逻辑,改为使用 e.Variable 属性
This commit is contained in:
29
DMS.Application/Events/VariableValueChangedEventArgs.cs
Normal file
29
DMS.Application/Events/VariableValueChangedEventArgs.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user