automapper框架优化

This commit is contained in:
hsc
2026-06-10 15:04:11 +08:00
parent 5452857299
commit 2e07c0c446
43 changed files with 612 additions and 293 deletions

View File

@@ -13,7 +13,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using UIShare.GlobalVariable;
using static UIShare.UIViewModel.ParameterModel;
using static UIShare.UIViewModel.ParameterVM;
namespace UIShare
@@ -26,7 +26,7 @@ namespace UIShare
private IContainerProvider containerProvider;
private IEventAggregator _eventAggregator;
private readonly Dictionary<Guid, ParameterModel> tmpParameters = [];
private readonly Dictionary<Guid, ParameterVM> tmpParameters = [];
private readonly Stopwatch stepStopwatch = new();
@@ -46,7 +46,7 @@ namespace UIShare
_eventAggregator = eventAggregator;
//_devices = containerProvider.Resolve<Devices>();
}
public async Task<bool> ExecuteErrorSteps(ProgramModel program, int depth = 0, CancellationToken cancellationToken = default)
public async Task<bool> ExecuteErrorSteps(ProgramVM program, int depth = 0, CancellationToken cancellationToken = default)
{
int index = 0;
bool stepSuccess = false;
@@ -211,7 +211,7 @@ namespace UIShare
return loopStack.Count == 0 && stepSuccess;
}
public async Task<bool> ExecuteSteps(ProgramModel program, int depth = 0, CancellationToken cancellationToken = default)
public async Task<bool> ExecuteSteps(ProgramVM program, int depth = 0, CancellationToken cancellationToken = default)
{
int index = 0;
bool stepSuccess = false;
@@ -388,7 +388,7 @@ namespace UIShare
return loopStack.Count == 0 && stepSuccess;
}
public async Task ExecuteMethodStep(StepModel step, Dictionary<Guid, ParameterModel> parameters, int depth, CancellationToken cancellationToken = default)
public async Task ExecuteMethodStep(StepVM step, Dictionary<Guid, ParameterVM> parameters, int depth, CancellationToken cancellationToken = default)
{
try
{
@@ -417,7 +417,7 @@ namespace UIShare
// 3. 准备参数
var inputParams = new List<object?>();
var paramTypes = new List<Type>();
ParameterModel? outputParam = null;
ParameterVM? outputParam = null;
foreach (var param in step.Method!.Parameters)
{
if (param.Category == ParameterCategory.Input)
@@ -656,7 +656,7 @@ namespace UIShare
}
}
public void ResetAllStepStatus(ObservableCollection<StepModel> StepCollection)
public void ResetAllStepStatus(ObservableCollection<StepVM> StepCollection)
{
foreach (var step in StepCollection)
{
@@ -665,7 +665,7 @@ namespace UIShare
}
}
private void UpdateCurrentStepResult(StepModel step, bool paraResult = true, bool stepResult = true, int depth = 0)
private void UpdateCurrentStepResult(StepVM step, bool paraResult = true, bool stepResult = true, int depth = 0)
{
if (stepResult && paraResult)
{
@@ -721,7 +721,7 @@ namespace UIShare
public int LoopCount { get; set; }
public int CurrentLoop { get; set; }
public int StartIndex { get; set; }
public StepModel? LoopStartStep { get; set; }
public StepVM? LoopStartStep { get; set; }
}
#endregion