准备将逻辑树变更方法迁移到可变容器元素中

This commit is contained in:
zengwenjie
2025-09-16 10:11:40 +08:00
parent 0dd8696c78
commit 35447c65d9
11 changed files with 68 additions and 18 deletions

View File

@@ -92,18 +92,21 @@ namespace Deedy.Activity
/// <summary> /// <summary>
/// 动作节点 /// 动作节点
/// </summary> /// </summary>
public IActionElement DeedyAction public IActionElement ActionElement
{ {
get { return (IActionElement)GetValue(DeedyActionProperty); } get { return (IActionElement)GetValue(ActionElementProperty); }
set { SetValue(DeedyActionProperty, value); } set { SetValue(ActionElementProperty, value); }
} }
public static readonly DependencyProperty DeedyActionProperty =
DependencyProperty.Register("DeedyAction", typeof(IActionElement), typeof(ActionViewer), new PropertyMetadata(null, public Runtime Runtime => throw new NotImplementedException();
(d, e) => (d as ActionViewer)?.DeedyAction_PropertyChangedCallback(e)));
public static readonly DependencyProperty ActionElementProperty =
DependencyProperty.Register("ActionElement", typeof(IActionElement), typeof(ActionViewer), new PropertyMetadata(null,
(d, e) => (d as ActionViewer)?.ActionElement_PropertyChangedCallback(e)));
/// <summary> /// <summary>
/// 处理「DeedyActionViewer.DeedyAction」属性变更 /// 处理「ActionElementViewer.ActionElement」属性变更
/// </summary> /// </summary>
protected virtual void DeedyAction_PropertyChangedCallback(DependencyPropertyChangedEventArgs e) protected virtual void ActionElement_PropertyChangedCallback(DependencyPropertyChangedEventArgs e)
{ {
// //
} }
@@ -111,5 +114,15 @@ namespace Deedy.Activity
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void ReadyToEditing(Runtime runtime)
{
throw new NotImplementedException();
}
public void ReadyToRunning(Runtime runtime)
{
throw new NotImplementedException();
}
} }
} }

View File

@@ -21,6 +21,8 @@ namespace Deedy.Activity
public IElement RootElement => (this.ParentElement == null) ? this : this.ParentElement.RootElement; public IElement RootElement => (this.ParentElement == null) ? this : this.ParentElement.RootElement;
public Runtime Runtime => throw new NotImplementedException();
public event PropertyChangedEventHandler? PropertyChanged; public event PropertyChangedEventHandler? PropertyChanged;
/// <summary> /// <summary>
@@ -74,5 +76,15 @@ namespace Deedy.Activity
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void ReadyToEditing(Runtime runtime)
{
throw new NotImplementedException();
}
public void ReadyToRunning(Runtime runtime)
{
throw new NotImplementedException();
}
} }
} }

View File

@@ -8,7 +8,7 @@ namespace Deedy.Activity
{ {
public interface IContainerElement : ICombinedElement public interface IContainerElement : ICombinedElement
{ {
public void Append(IElement deedyElement); public void Append(IElement element);
public void Remove(IElement deedyElement); public void Remove(IElement element);
} }
} }

View File

@@ -6,8 +6,8 @@ using System.Threading.Tasks;
namespace Deedy.Activity namespace Deedy.Activity
{ {
public abstract class AtomicityStep : FlowAction public abstract class AtomicityLogical : FlowAction
{ {
public AtomicityStep() { } public AtomicityLogical() { }
} }
} }

View File

@@ -6,9 +6,9 @@ using System.Threading.Tasks;
namespace Deedy.Activity namespace Deedy.Activity
{ {
public abstract class CombinedNode : FlowAction, ICombinedElement public abstract class CombinedLogical : FlowAction, ICombinedElement
{ {
public CombinedNode() { } public CombinedLogical() { }
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
} }

View File

@@ -6,9 +6,9 @@ using System.Threading.Tasks;
namespace Deedy.Activity namespace Deedy.Activity
{ {
public abstract class ContainerBlock : FlowAction, IContainerElement public abstract class ContainerLogical : FlowAction, IContainerElement
{ {
public ContainerBlock() { } public ContainerLogical() { }
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }

View File

@@ -48,5 +48,14 @@ namespace Deedy.Activity
if (typeof(TValue).IsInstanceOfType(value)) return (TValue?)value; if (typeof(TValue).IsInstanceOfType(value)) return (TValue?)value;
throw new Exception("对象上指定属性的当前值不是期望类型的有效实例..."); throw new Exception("对象上指定属性的当前值不是期望类型的有效实例...");
} }
/// <summary>
/// 帮助一个IElement节点构建参数映射表
/// </summary>
/// <param name="element">需要构建参数映射表的Element节点</param>
/// <param name="output">消息输出器</param>
internal static void BuildParamMapping(this IElement element, Output? output = null)
{
//
}
} }
} }

View File

@@ -21,6 +21,8 @@ namespace Deedy.Activity
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public Runtime Runtime => throw new NotImplementedException();
public event PropertyChangedEventHandler? PropertyChanged; public event PropertyChangedEventHandler? PropertyChanged;
/// <summary> /// <summary>
@@ -86,5 +88,15 @@ namespace Deedy.Activity
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void ReadyToEditing(Runtime runtime)
{
throw new NotImplementedException();
}
public void ReadyToRunning(Runtime runtime)
{
throw new NotImplementedException();
}
} }
} }

View File

@@ -12,6 +12,6 @@ namespace Deedy.Activity
public interface IActionViewer : IActivity, INotifyPropertyChanged public interface IActionViewer : IActivity, INotifyPropertyChanged
{ {
[AllowNull] [AllowNull]
public IActionElement DeedyAction { get; set; } public IActionElement ActionElement { get; set; }
} }
} }

View File

@@ -8,6 +8,9 @@ namespace Deedy.Activity
{ {
public interface IActivity public interface IActivity
{ {
public Runtime Runtime { get; }
public void ReadyToWorking(IElement? element = null, Output? output = null); public void ReadyToWorking(IElement? element = null, Output? output = null);
public void ReadyToEditing(Runtime runtime);
public void ReadyToRunning(Runtime runtime);
} }
} }

View File

@@ -67,7 +67,8 @@ namespace Deedy.Activity
/// <param name="parent"></param> /// <param name="parent"></param>
public new void ReadyToWorking(IElement? element = null, Output? output = null) public new void ReadyToWorking(IElement? element = null, Output? output = null)
{ {
//TODO刷新参数映射 this.BuildParamMapping(output);
this.LinkTo(element); this.LinkTo(element);
if (this is IContainerElement container) if (this is IContainerElement container)
foreach (IElement subElement in container.Elements) foreach (IElement subElement in container.Elements)