临时提交
This commit is contained in:
@@ -97,39 +97,6 @@ public partial class DataServices : ObservableRecipient, IRecipient<LoadMessage>
|
||||
// AllVariables = new ConcurrentDictionary<int, Variable>();
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// 接收加载消息,根据消息类型从数据库加载对应的数据。
|
||||
// /// </summary>
|
||||
// /// <param name="message">加载消息,包含要加载的数据类型。</param>
|
||||
// /// <exception cref="ArgumentException">如果加载类型未知,可能会抛出此异常(尽管当前实现中未显式抛出)。</exception>
|
||||
// public async void Receive(LoadMessage message)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// switch (message.LoadType)
|
||||
// {
|
||||
// case LoadTypes.All: // 加载所有数据
|
||||
// await LoadDevices();
|
||||
// await LoadMenus();
|
||||
// await LoadMqtts();
|
||||
// break;
|
||||
// case LoadTypes.Devices: // 仅加载设备数据
|
||||
// await LoadDevices();
|
||||
// break;
|
||||
// case LoadTypes.Menu: // 仅加载菜单数据
|
||||
// await LoadMenus();
|
||||
// break;
|
||||
// case LoadTypes.Mqtts: // 仅加载MQTT配置数据
|
||||
// await LoadMqtts();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// // 捕获加载数据时发生的异常,并通过通知和日志记录错误信息。
|
||||
// NotificationHelper.ShowError($"加载数据出现了错误:{e.Message}", e);
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// 异步加载设备数据,并以高效的方式更新UI集合。
|
||||
@@ -186,17 +153,6 @@ public partial class DataServices : ObservableRecipient, IRecipient<LoadMessage>
|
||||
}
|
||||
}
|
||||
|
||||
// private void Device_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
// {
|
||||
// if (e.PropertyName == nameof(Device.IsActive))
|
||||
// {
|
||||
// if (sender is Device device)
|
||||
// {
|
||||
// NlogHelper.Info($"设备 {device.Name} 的IsActive状态改变为 {device.IsActive},触发设备IsActive状态变更事件。");
|
||||
// OnDeviceIsActiveChanged?.Invoke(device, device.IsActive);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// 异步加载菜单数据,并以高效的方式更新UI集合。
|
||||
@@ -292,36 +248,6 @@ public partial class DataServices : ObservableRecipient, IRecipient<LoadMessage>
|
||||
}
|
||||
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// 异步根据ID获取设备数据。
|
||||
// /// </summary>
|
||||
// /// <param name="id">设备ID。</param>
|
||||
// /// <returns>设备对象,如果不存在则为null。</returns>
|
||||
// public async Task<Device> GetDeviceByIdAsync(int id)
|
||||
// {
|
||||
// return await _deviceRepository.GetByIdAsync(id);
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// 异步加载变量数据。
|
||||
// /// </summary>
|
||||
// /// <returns>表示异步操作的任务。</returns>
|
||||
// private async Task LoadVariables()
|
||||
// {
|
||||
// Variables = await _varDataRepository.GetAllAsync();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 异步更新变量数据。
|
||||
// /// </summary>
|
||||
// /// <param name="variable">要更新的变量数据。</param>
|
||||
// /// <returns>表示异步操作的任务。</returns>
|
||||
// public async Task UpdateVariableAsync(Variable variable)
|
||||
// {
|
||||
// await _variableAppService.UpdateVariableAsync(_mapper.Map<VariableDto>(variable));
|
||||
// }
|
||||
|
||||
public void Receive(LoadMessage message)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user