定义容器节点辅助方法
This commit is contained in:
@@ -56,22 +56,6 @@ namespace Deedy.Activity
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void InsertToFore(IElement element)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertAtRear(IElement element)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SwapIndex(IElement element)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void ReadyToWorking(IElement? element = null, Output? output = null)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@@ -8,10 +8,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Deedy.Activity
|
||||
{
|
||||
public class DeedyElementCollection : ObservableCollection<IElement>
|
||||
public class ElementCollection : ObservableCollection<IElement>
|
||||
{
|
||||
public DeedyElementCollection() : this(false) { }
|
||||
public DeedyElementCollection(bool needDistinct = false)
|
||||
public ElementCollection() : this(false) { }
|
||||
public ElementCollection(bool needDistinct = false)
|
||||
{
|
||||
this._needDistinct = needDistinct;
|
||||
}
|
||||
@@ -9,6 +9,6 @@ namespace Deedy.Activity
|
||||
{
|
||||
public interface ICombinedElement : IElement
|
||||
{
|
||||
public DeedyElementCollection Elements { get; set; }
|
||||
public ElementCollection Elements { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,13 @@ namespace Deedy.Activity
|
||||
{
|
||||
public interface IContainerElement : ICombinedElement
|
||||
{
|
||||
public void Append(IElement element);
|
||||
public void Remove(IElement element);
|
||||
public void Append(IElement element) => this.Elements.Add(element);
|
||||
public void Remove(IElement element) => this.Elements.Remove(element);
|
||||
public void Insert(IElement element, uint index)
|
||||
{
|
||||
if (element == null) return;
|
||||
if (index < this.Elements.Count) this.Elements.Insert((int)index, element);
|
||||
if (index >= this.Elements.Count) this.Elements.Add(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ namespace Deedy.Activity
|
||||
{
|
||||
public CombinedLogical() { }
|
||||
|
||||
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public ElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,16 +10,6 @@ namespace Deedy.Activity
|
||||
{
|
||||
public ContainerLogical() { }
|
||||
|
||||
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public void Append(IElement deedyElement)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Remove(IElement deedyElement)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public ElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ namespace Deedy.Activity
|
||||
{
|
||||
public CombinedFunction() { }
|
||||
|
||||
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public ElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Deedy.Activity
|
||||
{
|
||||
public ContainerFunction() { }
|
||||
|
||||
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public ElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public void Append(IElement deedyElement)
|
||||
{
|
||||
|
||||
@@ -53,9 +53,35 @@ namespace Deedy.Activity
|
||||
/// </summary>
|
||||
/// <param name="element">需要构建参数映射表的Element节点</param>
|
||||
/// <param name="output">消息输出器</param>
|
||||
internal static void BuildParamMapping(this IElement element, Output? output = null)
|
||||
public static void BuildParamMapping(this IElement element, Output? output = null)
|
||||
{
|
||||
//
|
||||
}
|
||||
/// <summary>
|
||||
/// 将一个元素插入到当前节点前方「前提:当前节点的父级必须是可变容器节点」
|
||||
/// </summary>
|
||||
/// <param name="element">当前节点</param>
|
||||
/// <param name="insertion">待插入的节点</param>
|
||||
public static void InsertElementToFore(this IElement element, IElement insertion)
|
||||
{
|
||||
//
|
||||
}
|
||||
/// <summary>
|
||||
/// 将一个元素插入到当前节点后方「前提:当前节点的父级必须是可变容器节点」
|
||||
/// </summary>
|
||||
/// <param name="element">当前节点</param>
|
||||
/// <param name="insertion">待插入的节点</param>
|
||||
public static void InsertElementAtRear(this IElement element, IElement insertion)
|
||||
{
|
||||
//
|
||||
}
|
||||
/// <summary>
|
||||
/// 将当前节点从父节点中移除
|
||||
/// </summary>
|
||||
/// <param name="element">要移除的元素</param>
|
||||
public static void RemoveFromParent(this IElement element)
|
||||
{
|
||||
if (element != null && element.ParentElement is IContainerElement container) container.Remove(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Deedy.Activity
|
||||
|
||||
public IElement RootElement => (this.ParentElement == null) ? this : this.ParentElement.RootElement;
|
||||
|
||||
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public ElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public Runtime Runtime => throw new NotImplementedException();
|
||||
|
||||
@@ -68,22 +68,6 @@ namespace Deedy.Activity
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertToFore(IElement element)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertAtRear(IElement element)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SwapIndex(IElement element)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void ReadyToWorking(IElement? element = null, Output? output = null)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@@ -19,9 +19,6 @@ namespace Deedy.Activity
|
||||
public int DepthLevel { get; }
|
||||
public IElement? ParentElement { get; }
|
||||
public IElement RootElement { get; }
|
||||
public void InsertToFore(IElement element);
|
||||
public void InsertAtRear(IElement element);
|
||||
public void SwapIndex(IElement element);
|
||||
/// <summary>
|
||||
/// 将当前节点链接到一个节点上
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user