mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -28,57 +27,28 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
protected override void InitNew()
|
||||
{
|
||||
ItemWidth = double.NaN;
|
||||
ItemHeight = double.NaN;
|
||||
AddConnector(new BlockConnectorInfo(this.Root, this, ConnectorOrientation.Top));
|
||||
AddConnector(new BlockConnectorInfo(this.Root, this, ConnectorOrientation.Bottom));
|
||||
IsReadOnlyText = true;
|
||||
}
|
||||
|
||||
public BlockDesignerItemViewModel Next
|
||||
{
|
||||
get; set;
|
||||
get;set;
|
||||
}
|
||||
|
||||
public void AddNext(BlockDesignerItemViewModel next)
|
||||
{
|
||||
this.ParentId = new Guid();
|
||||
this.Parent = null;
|
||||
next.Left = this.Left;
|
||||
next.Top = this.Top + this.GetItemHeight();
|
||||
next.Top = this.Top + this.ItemHeight;
|
||||
next.ParentId = this.Id;
|
||||
next.Parent = this;
|
||||
this.Next = next;
|
||||
//if (oldnext != null)
|
||||
//{
|
||||
// next.AddNext(oldnext);
|
||||
//}
|
||||
}
|
||||
|
||||
public void RemoveNext()
|
||||
{
|
||||
var next = this.Next;
|
||||
if (next != null)
|
||||
if (next.Next != null)
|
||||
{
|
||||
next.ParentId = new Guid();
|
||||
next.Parent = null;
|
||||
this.Next = null;
|
||||
next.AddNext(next.Next);
|
||||
}
|
||||
}
|
||||
|
||||
public BlockDesignerItemViewModel GetLastNext()
|
||||
{
|
||||
var next = this.Next;
|
||||
if (next != null)
|
||||
{
|
||||
while (next.Next != null)
|
||||
{
|
||||
next = next.Next;
|
||||
}
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
public override void AddToSelection(bool selected, bool clearother)
|
||||
{
|
||||
if (clearother)
|
||||
@@ -94,31 +64,5 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
IsSelected = selected;
|
||||
}
|
||||
|
||||
|
||||
public virtual void AddChild(BlockDesignerItemViewModel child)
|
||||
{
|
||||
child.RemoveFromSelection();
|
||||
this.AddToSelection(true, false);
|
||||
}
|
||||
|
||||
public virtual void RemoveChild(BlockDesignerItemViewModel child)
|
||||
{
|
||||
this.RemoveFromSelection();
|
||||
child.AddToSelection(true, false);
|
||||
}
|
||||
|
||||
public ObservableCollection<ItemsContainerInfo> Contains
|
||||
{
|
||||
get; set;
|
||||
} = new ObservableCollection<ItemsContainerInfo>();
|
||||
|
||||
public ItemsContainerInfo FirstContain
|
||||
{
|
||||
get
|
||||
{
|
||||
return Contains?.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user