SH: recovery

This commit is contained in:
NickAppLab
2023-02-12 23:38:24 +05:00
parent f013ddae13
commit 784d3d3a5f
416 changed files with 5188 additions and 1338 deletions

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StructureHelper.Infrastructure.UI.DataContexts;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Shapes;
using Point = StructureHelper.Infrastructure.UI.DataContexts.PointViewPrimitive;
using Rectangle = StructureHelper.Infrastructure.UI.DataContexts.RectangleViewPrimitive;
namespace StructureHelper.Services.Primitives
{
public interface IPrimitiveRepository
{
IEnumerable<PrimitiveBase> Primitives { get; }
void Add(PrimitiveBase primitive);
void Delete(PrimitiveBase primitive);
void Clear();
}
}

View File

@@ -0,0 +1,36 @@
using StructureHelper.Infrastructure.UI.DataContexts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Services.Primitives
{
public class PrimitiveRepository : IPrimitiveRepository
{
List<PrimitiveBase> primitives;
public IEnumerable<PrimitiveBase> Primitives { get => primitives; }
public PrimitiveRepository()
{
primitives = new List<PrimitiveBase>();
}
public void Add(PrimitiveBase primitive)
{
primitives.Add(primitive);
}
public void Clear()
{
primitives = new List<PrimitiveBase>();
}
public void Delete(PrimitiveBase primitive)
{
primitives.Remove(primitive);
}
}
}