依赖注入顺序修改
This commit is contained in:
@@ -17,7 +17,6 @@ namespace UIShare.GlobalVariable
|
||||
public class DeviceManager
|
||||
{
|
||||
public SystemConfig _systemConfig { get; set; }
|
||||
public IList<IBaseInterface> DeviceList { get; private set; } = new List<IBaseInterface>();
|
||||
|
||||
/// <summary>按 DeviceName 索引的设备字典,便于业务层按名取实例。</summary>
|
||||
public IDictionary<string, IBaseInterface> DeviceMap { get; private set; }
|
||||
@@ -30,6 +29,7 @@ namespace UIShare.GlobalVariable
|
||||
{
|
||||
_systemConfig = systemConfig;
|
||||
InitDevices();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -83,8 +83,6 @@ namespace UIShare.GlobalVariable
|
||||
LoggerHelper.Warn($"设备 [{config.DeviceName}] 连接方式 [{config.ConnectionType}] 不支持,已跳过。");
|
||||
continue;
|
||||
}
|
||||
|
||||
DeviceList.Add(instance);
|
||||
if (!string.IsNullOrWhiteSpace(config.DeviceName))
|
||||
{
|
||||
DeviceMap[config.DeviceName] = instance;
|
||||
|
||||
Reference in New Issue
Block a user