public BaseSentenceAlgorithm Add(BaseSentenceAlgorithm alg) { if (Algorithms.FindByInternalName(alg.Info.InternalName, false) == null) Algorithms.Add(alg); else throw new Exception($"Алгоритм с именем {alg.Info.InternalName} уже существует"); return alg; }
public AlgorithmsContainer(BaseSentenceAlgorithm baseAlgorithm, AlgorithmsStageType algorithmsStageType) { _baseAlgorithm = baseAlgorithm; AlgorithmsStageType = algorithmsStageType; Algorithms = new List<BaseSentenceAlgorithm>(); }
private void _saveAlgorithmResults(AlgorithmsStageType containerType, BaseSentenceAlgorithm algorithm, BaseSentenceAlgorithmData resultData ) { _algorithmResults.Add(new AlgorithmResult { ContainerType = containerType, Algorithm = algorithm, Results = resultData.HelperDataElements, Sentence = resultData.Sentence, Log = _currentAlgLogMessages, FinalResults = resultData.FinalResults?.Select( pair => new DisplayFinalResults { WritableHelperData = pair.Value.HelperData, CheckResult = pair.Value.CheckResult, WritableType = pair.Key }).ToList() }); }