Add project ConvertFromStrategy
This commit is contained in:
@@ -28,11 +28,11 @@ namespace StructureHelperCommon.Infrastructures.Settings
|
||||
set
|
||||
{
|
||||
natSystem = value;
|
||||
codesList = CodeFactory
|
||||
codesList ??= CodeFactory
|
||||
.GetCodeEntities()
|
||||
.Where(x => x.NatSystem == natSystem)
|
||||
.ToList();
|
||||
materialRepository = new MaterialRepository(codesList);
|
||||
materialRepository ??= new MaterialRepository(codesList);
|
||||
}
|
||||
}
|
||||
public static GeometryNames GeometryNames => geometryNames ??= new GeometryNames();
|
||||
@@ -53,6 +53,10 @@ namespace StructureHelperCommon.Infrastructures.Settings
|
||||
{
|
||||
get
|
||||
{
|
||||
codesList ??= CodeFactory
|
||||
.GetCodeEntities()
|
||||
.Where(x => x.NatSystem == NatSystem)
|
||||
.ToList();
|
||||
materialRepository ??= new MaterialRepository(codesList);
|
||||
return materialRepository;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ namespace StructureHelperCommon.Models.Analyses
|
||||
{
|
||||
public interface IVisualAnalysis : ISaveable, ICloneable
|
||||
{
|
||||
IAnalysis Analysis {get;set;}
|
||||
IAnalysis Analysis { get; set; }
|
||||
Action ActionToRun { get; set; }
|
||||
void Run();
|
||||
}
|
||||
}
|
||||
|
||||
38
StructureHelperCommon/Models/Analyses/VisualAnalysis.cs
Normal file
38
StructureHelperCommon/Models/Analyses/VisualAnalysis.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Analyses;
|
||||
using System;
|
||||
|
||||
namespace StructureHelperCommon.Models.Analyses
|
||||
{
|
||||
public class VisualAnalysis : IVisualAnalysis
|
||||
{
|
||||
private IUpdateStrategy<IVisualAnalysis> updateStrategy = new VisualAnalysisUpdateStrategy();
|
||||
public Guid Id { get; }
|
||||
public IAnalysis Analysis { get; set; }
|
||||
public Action ActionToRun { get; set; }
|
||||
|
||||
public VisualAnalysis(Guid id, IAnalysis analysis)
|
||||
{
|
||||
Id = id;
|
||||
Analysis = analysis;
|
||||
}
|
||||
|
||||
public VisualAnalysis(IAnalysis analysis) : this (Guid.NewGuid(), analysis)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
ActionToRun?.Invoke();
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
var newAnalysis = Analysis.Clone() as IAnalysis;
|
||||
VisualAnalysis newItem = new(newAnalysis);
|
||||
return newItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user