Edition of primitives is changed
This commit is contained in:
21
Services/Primitives/IPrimitiveRepository.cs
Normal file
21
Services/Primitives/IPrimitiveRepository.cs
Normal 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.Models.NdmPrimitives;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using Point = StructureHelper.Infrastructure.UI.DataContexts.Point;
|
||||
using Rectangle = StructureHelper.Infrastructure.UI.DataContexts.Rectangle;
|
||||
|
||||
namespace StructureHelper.Services.Primitives
|
||||
{
|
||||
public interface IPrimitiveRepository
|
||||
{
|
||||
IEnumerable<PrimitiveBase> Primitives { get; }
|
||||
void Add(PrimitiveBase primitive);
|
||||
void Delete(PrimitiveBase primitive);
|
||||
void Clear();
|
||||
}
|
||||
}
|
||||
36
Services/Primitives/PrimitiveRepository.cs
Normal file
36
Services/Primitives/PrimitiveRepository.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user