Add primitive visual property
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperCommon.Services;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
|
||||
@@ -10,6 +11,7 @@ namespace DataAccess.DTOs
|
||||
{
|
||||
private Dictionary<(Guid id, Type type), ISaveable> referenceDictionary;
|
||||
private IShiftTraceLogger traceLogger;
|
||||
private IUpdateStrategy<IHasVisualProperty> visualUpdateStrategy;
|
||||
|
||||
public HasStirrupsFromDTOUpdateStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
|
||||
{
|
||||
@@ -63,7 +65,8 @@ namespace DataAccess.DTOs
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(stirrup));
|
||||
}
|
||||
|
||||
visualUpdateStrategy = new HasVisualPropertyFromDTOUpdateStrategy(referenceDictionary, traceLogger);
|
||||
visualUpdateStrategy.Update(newItem, stirrup);
|
||||
return newItem;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperCommon.Services;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
|
||||
@@ -10,6 +11,7 @@ namespace DataAccess.DTOs
|
||||
{
|
||||
private Dictionary<(Guid id, Type type), ISaveable> referenceDictionary;
|
||||
private IShiftTraceLogger traceLogger;
|
||||
private IUpdateStrategy<IHasVisualProperty> visualUpdateStrategy;
|
||||
|
||||
public HasStirrupsToDTOUpdateStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
|
||||
{
|
||||
@@ -64,6 +66,8 @@ namespace DataAccess.DTOs
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(stirrup));
|
||||
}
|
||||
visualUpdateStrategy = new HasVisualPropertyToDTOUpdateStrategy(referenceDictionary, traceLogger);
|
||||
visualUpdateStrategy.Update(newItem, stirrup);
|
||||
return newItem;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
@@ -14,6 +15,7 @@ namespace DataAccess.DTOs
|
||||
{
|
||||
private IUpdateStrategy<IStirrupByInclinedRebar> updateStrategy;
|
||||
private IConvertStrategy<RebarSectionDTO, IRebarSection> rebarConvertStrategy;
|
||||
|
||||
|
||||
public StirrupByInclinedRebarToDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger) : base(referenceDictionary, traceLogger)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.Models.BeamShears.Logics;
|
||||
using System;
|
||||
@@ -15,6 +16,7 @@ namespace DataAccess.DTOs
|
||||
private IUpdateStrategy<IStirrupGroup> updateStrategy;
|
||||
private IUpdateStrategy<IHasStirrups> stirrupUpdateStrategy;
|
||||
|
||||
|
||||
public StirrupGroupToDTOConvertStrategy(
|
||||
Dictionary<(Guid id, Type type), ISaveable> referenceDictionary,
|
||||
IShiftTraceLogger traceLogger)
|
||||
@@ -34,7 +36,7 @@ namespace DataAccess.DTOs
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
updateStrategy ??= new StirrupGroupUpdateStrategy();
|
||||
updateStrategy ??= new StirrupGroupUpdateStrategy() { UpdateChildren = false};
|
||||
stirrupUpdateStrategy ??= new HasStirrupsToDTOUpdateStrategy(ReferenceDictionary, TraceLogger);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user