定义只读集合容器与不可变集合容器

This commit is contained in:
zengwenjie
2025-09-15 15:48:54 +08:00
parent 2bfb27f755
commit c77394c378
7 changed files with 82 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Design
{
public interface IContainerElement : IDeedyElement
{
public DeedyElementCollection Elements { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Design
{
public interface IVariableContainer : IContainerElement
{
public void Append(IDeedyElement deedyElement);
public void Remove(IDeedyElement deedyElement);
public void SwapIndex(IDeedyElement element1, IDeedyElement element2);
}
}

View File

@@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<None Remove="DeedyAction.cs~RF1708d6d.TMP" />
<None Remove="DeedyVisual.cs~RF13b8243.TMP" />
</ItemGroup>

View File

@@ -53,5 +53,15 @@ namespace Deedy.Design
OnPropertyChanged(propertyName);
return true;
}
public void InsertInFront(IDeedyElement deedyElement)
{
throw new NotImplementedException();
}
public void InsertAtRear(IDeedyElement deedyElement)
{
throw new NotImplementedException();
}
}
}

View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace Deedy.Design
{
public class DeedyVisual : IDeedyVisual
public class DeedyLayout : IDeedyLayout
{
public string DEClass { get; protected internal set; } = "";
public string DETitle { get; set; } = "";
@@ -19,6 +19,8 @@ namespace Deedy.Design
public IDeedyElement DeedyRoot => (this.DeedyParent == null) ? this : this.DeedyParent.DeedyRoot;
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public event PropertyChangedEventHandler? PropertyChanged;
/// <summary>
@@ -54,5 +56,30 @@ namespace Deedy.Design
OnPropertyChanged(propertyName);
return true;
}
public void Append(IDeedyElement deedyElement)
{
throw new NotImplementedException();
}
public void Remove(IDeedyElement deedyElement)
{
throw new NotImplementedException();
}
public void InsertInFront(IDeedyElement deedyElement)
{
throw new NotImplementedException();
}
public void InsertAtRear(IDeedyElement deedyElement)
{
throw new NotImplementedException();
}
public void SwapIndex(IDeedyElement element1, IDeedyElement element2)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Design
{
public interface IDeedyLayout : IVariableContainer
{
}
}

View File

@@ -16,6 +16,7 @@ namespace Deedy.Design
public string DEIdentify { get; set; }
public IDeedyElement? DeedyParent { get; }
public IDeedyElement DeedyRoot { get; }
public DeedyElementCollection Children { get; set; }
public void InsertInFront(IDeedyElement deedyElement);
public void InsertAtRear(IDeedyElement deedyElement);
}
}