重命名基础类型

This commit is contained in:
zengwenjie
2025-09-16 09:32:07 +08:00
parent 7db5f8a9d9
commit 0dd8696c78
13 changed files with 46 additions and 51 deletions

View File

@@ -107,7 +107,7 @@ namespace Deedy.Activity
{
//
}
public void ReadyToWorking(IElementActivity? element = null, Output? output = null)
public void ReadyToWorking(IElement? element = null, Output? output = null)
{
throw new NotImplementedException();
}

View File

@@ -16,10 +16,10 @@ namespace Deedy.Activity
public string DERemark { get; set; } = "";
public string DEIdentify { get; set; } = "";
public int DepthLevel { get; protected internal set; } = 0;
public IElementActivity? ParentElement { get; protected internal set; }
public IElement? ParentElement { get; protected internal set; }
public IActionViewer? ActionViewer { get; protected internal set; }
public IElementActivity RootElement => (this.ParentElement == null) ? this : this.ParentElement.RootElement;
public IElement RootElement => (this.ParentElement == null) ? this : this.ParentElement.RootElement;
public event PropertyChangedEventHandler? PropertyChanged;
@@ -55,22 +55,22 @@ namespace Deedy.Activity
return true;
}
public void InsertToFore(IElementActivity deedyElement)
public void InsertToFore(IElement element)
{
throw new NotImplementedException();
}
public void InsertAtRear(IElementActivity deedyElement)
public void InsertAtRear(IElement element)
{
throw new NotImplementedException();
}
public void SwapIndex(IElementActivity deedyElement)
public void SwapIndex(IElement element)
{
throw new NotImplementedException();
}
public void ReadyToWorking(IElementActivity? element = null, Output? output = null)
public void ReadyToWorking(IElement? element = null, Output? output = null)
{
throw new NotImplementedException();
}

View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace Deedy.Activity
{
public class DeedyElementCollection : ObservableCollection<IElementActivity>
public class DeedyElementCollection : ObservableCollection<IElement>
{
public DeedyElementCollection() : this(false) { }
public DeedyElementCollection(bool needDistinct = false)
@@ -16,15 +16,15 @@ namespace Deedy.Activity
this._needDistinct = needDistinct;
}
private bool _needDistinct = false;
public void AddRange(params IElementActivity[] elements)
public void AddRange(params IElement[] elements)
{
foreach (var element in elements) this.Add(element);
}
public void AddRange([AllowNull] IEnumerable<IElementActivity> elements)
public void AddRange([AllowNull] IEnumerable<IElement> elements)
{
if (elements != null) foreach (var element in elements) this.Add(element);
}
public new void Add([AllowNull] IElementActivity element)
public new void Add([AllowNull] IElement element)
{
if (element == null) return;
if (this._needDistinct)

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Deedy.Activity
{
public interface ICombinedElement : IElementActivity
public interface ICombinedElement : IElement
{
public DeedyElementCollection Elements { get; set; }
}

View File

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

View File

@@ -12,12 +12,12 @@ namespace Deedy.Activity
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public void Append(IElementActivity deedyElement)
public void Append(IElement deedyElement)
{
throw new NotImplementedException();
}
public void Remove(IElementActivity deedyElement)
public void Remove(IElement deedyElement)
{
throw new NotImplementedException();
}

View File

@@ -12,12 +12,12 @@ namespace Deedy.Activity
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public void Append(IElementActivity deedyElement)
public void Append(IElement deedyElement)
{
throw new NotImplementedException();
}
public void Remove(IElementActivity deedyElement)
public void Remove(IElement deedyElement)
{
throw new NotImplementedException();
}

View File

@@ -15,9 +15,9 @@ namespace Deedy.Activity
public string DERemark { get; set; } = "";
public string DEIdentify { get; set; } = "";
public int DepthLevel { get; protected internal set; } = 0;
public IElementActivity? ParentElement { get; protected internal set; }
public IElement? ParentElement { get; protected internal set; }
public IElementActivity RootElement => (this.ParentElement == null) ? this : this.ParentElement.RootElement;
public IElement RootElement => (this.ParentElement == null) ? this : this.ParentElement.RootElement;
public DeedyElementCollection Elements { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
@@ -57,37 +57,32 @@ namespace Deedy.Activity
return true;
}
public void Append(IElementActivity deedyElement)
public void Append(IElement element)
{
throw new NotImplementedException();
}
public void Remove(IElementActivity deedyElement)
public void Remove(IElement element)
{
throw new NotImplementedException();
}
public void InsertToFore(IElementActivity deedyElement)
public void InsertToFore(IElement element)
{
throw new NotImplementedException();
}
public void InsertAtRear(IElementActivity deedyElement)
public void InsertAtRear(IElement element)
{
throw new NotImplementedException();
}
public void SwapIndex(IElementActivity element1, IElementActivity element2)
public void SwapIndex(IElement element)
{
throw new NotImplementedException();
}
public void SwapIndex(IElementActivity deedyElement)
{
throw new NotImplementedException();
}
public void ReadyToWorking(IElementActivity? element = null, Output? output = null)
public void ReadyToWorking(IElement? element = null, Output? output = null)
{
throw new NotImplementedException();
}

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Deedy.Activity
{
public interface IActionElement : IElementActivity
public interface IActionElement : IElement
{
public IActionViewer? ActionViewer { get; }
}

View File

@@ -9,7 +9,7 @@ using System.Windows;
namespace Deedy.Activity
{
public interface IActionViewer : IDeedyActivity, INotifyPropertyChanged
public interface IActionViewer : IActivity, INotifyPropertyChanged
{
[AllowNull]
public IActionElement DeedyAction { get; set; }

View File

@@ -6,8 +6,8 @@ using System.Threading.Tasks;
namespace Deedy.Activity
{
public interface IDeedyActivity
public interface IActivity
{
public void ReadyToWorking(IElementActivity? element = null, Output? output = null);
public void ReadyToWorking(IElement? element = null, Output? output = null);
}
}

View File

@@ -10,23 +10,23 @@ using System.Windows.Markup;
namespace Deedy.Activity
{
public interface IElementActivity : IDeedyActivity, INotifyPropertyChanged
public interface IElement : IActivity, INotifyPropertyChanged
{
public string DEClass { get; }
public string DETitle { get; set; }
public string DERemark { get; set; }
public string DEIdentify { get; set; }
public int DepthLevel { get; }
public IElementActivity? ParentElement { get; }
public IElementActivity RootElement { get; }
public void InsertToFore(IElementActivity deedyElement);
public void InsertAtRear(IElementActivity deedyElement);
public void SwapIndex(IElementActivity deedyElement);
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>
/// <param name="element">要链接到的节点</param>
public virtual void LinkTo([AllowNull] IElementActivity element)
public virtual void LinkTo([AllowNull] IElement element)
{
if (element == null)
{
@@ -58,26 +58,26 @@ namespace Deedy.Activity
public virtual void Unlink()
{
(this.ParentElement as IContainerElement)?.Remove(this);
this.SetNamedPropertyValue<IElementActivity?>(nameof(ParentElement), null);
this.SetNamedPropertyValue<IElement?>(nameof(ParentElement), null);
this.SetNamedPropertyValue(nameof(DepthLevel), 0);
}
/// <summary>
/// 构建结构树,设置层级:并且完成参数映射的刷新
/// </summary>
/// <param name="parent"></param>
public new void ReadyToWorking(IElementActivity? element = null, Output? output = null)
public new void ReadyToWorking(IElement? element = null, Output? output = null)
{
//TODO刷新参数映射
this.LinkTo(element);
if (this is IContainerElement container)
foreach (IElementActivity subElement in container.Elements)
foreach (IElement subElement in container.Elements)
subElement.ReadyToWorking(this);
}
public virtual IElementActivity? Clone()
public virtual IElement? Clone()
{
try
{
return XamlReader.Parse(XamlWriter.Save(this)) as IElementActivity;
return XamlReader.Parse(XamlWriter.Save(this)) as IElement;
}
catch { return null; }
}
@@ -92,13 +92,13 @@ namespace Deedy.Activity
catch { document = string.Empty; }
return result;
}
public static virtual bool TryDecode(string document, out IElementActivity? element)
public static virtual bool TryDecode(string document, out IElement? element)
{
IElementActivity? instance = null;
IElement? instance = null;
bool result = false;
try
{
instance = XamlReader.Parse(document) as IElementActivity;
instance = XamlReader.Parse(document) as IElement;
result = instance != null;
}
catch { }

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Deedy.Activity
{
public interface IVisualElement : IElementActivity
public interface IVisualElement : IElement
{
}
}