Add VisualAnalysisDTO

This commit is contained in:
Evgeny Redikultsev
2024-09-14 19:03:35 +05:00
parent 5a9e7c3c4f
commit c10d6eb94e
84 changed files with 958 additions and 410 deletions

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Analyses
{
public class Version : IVersion
public class DateVersion : IDateVersion
{
public DateTime DateTime { get; set; }

View File

@@ -0,0 +1,22 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Analyses
{
public class DateVersionUpdateStrategy : IUpdateStrategy<IDateVersion>
{
public void Update(IDateVersion targetObject, IDateVersion sourceObject)
{
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
if (ReferenceEquals(targetObject, sourceObject)) { return; };
targetObject.DateTime = sourceObject.DateTime;
}
}
}

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Analyses
{
public interface IAnalysis : ISaveable
public interface IAnalysis : ISaveable, ICloneable
{
string Name { get; set; }
string Tags { get; set; }

View File

@@ -7,9 +7,9 @@ using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Analyses
{
public interface IVersion
public interface IDateVersion
{
DateTime DateTime { get; }
DateTime DateTime { get; set; }
ISaveable Item { get; set; }
}
}

View File

@@ -10,7 +10,7 @@ namespace StructureHelperCommon.Models.Analyses
public interface IVersionProcessor : ISaveable
{
void AddVersion(ISaveable newItem);
List<IVersion> Versions { get; }
IVersion GetCurrentVersion();
List<IDateVersion> Versions { get; }
IDateVersion GetCurrentVersion();
}
}

View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Analyses
{
public interface IVisualAnalysis : ISaveable
public interface IVisualAnalysis : ISaveable, ICloneable
{
IAnalysis Analysis {get;set;}
void Run();

View File

@@ -9,7 +9,7 @@ namespace StructureHelperCommon.Models.Analyses
{
public class VersionProcessor : IVersionProcessor
{
public List<IVersion> Versions { get; }
public List<IDateVersion> Versions { get; }
public Guid Id { get; }
@@ -24,14 +24,14 @@ namespace StructureHelperCommon.Models.Analyses
}
private void AddVersion(IVersion version)
private void AddVersion(IDateVersion version)
{
Versions.Add(version);
}
public void AddVersion(ISaveable newItem)
{
var version = new Version()
var version = new DateVersion()
{
DateTime = DateTime.Now,
Item = newItem
@@ -40,7 +40,7 @@ namespace StructureHelperCommon.Models.Analyses
}
public IVersion GetCurrentVersion()
public IDateVersion GetCurrentVersion()
{
return Versions[^1];
}

View File

@@ -0,0 +1,18 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Analyses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Analyses
{
public class VisualAnalysisUpdateStrategy : IUpdateStrategy<IVisualAnalysis>
{
public void Update(IVisualAnalysis targetObject, IVisualAnalysis sourceObject)
{
throw new NotImplementedException();
}
}
}