Material Update Strategy was added
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
internal class MaterialPartialFactorUpdateStrategy : IUpdateStrategy<IMaterialPartialFactor>
|
||||
{
|
||||
public void Update(IMaterialPartialFactor targetObject, IMaterialPartialFactor sourceObject)
|
||||
{
|
||||
targetObject.LimitState = sourceObject.LimitState;
|
||||
targetObject.StressState = sourceObject.StressState;
|
||||
targetObject.CalcTerm = sourceObject.CalcTerm;
|
||||
targetObject.FactorValue = sourceObject.FactorValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
internal class MaterialSafetyFactorUpdateStrategy : IUpdateStrategy<IMaterialSafetyFactor>
|
||||
{
|
||||
public void Update(IMaterialSafetyFactor targetObject, IMaterialSafetyFactor sourceObject)
|
||||
{
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.Take = sourceObject.Take;
|
||||
targetObject.Description = sourceObject.Description;
|
||||
targetObject.PartialFactors.Clear();
|
||||
foreach (var item in sourceObject.PartialFactors)
|
||||
{
|
||||
targetObject.PartialFactors.Add(item.Clone() as IMaterialPartialFactor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user