mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-13 13:09:28 +08:00
block
This commit is contained in:
@@ -248,7 +248,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
Children.Remove(child);
|
||||
}
|
||||
|
||||
public List<BlockItemsContainerInfo> GetAllContain(ObservableCollection<BlockDesignerItemViewModel> children, bool self)
|
||||
public List<BlockItemsContainerInfo> GetAllContainers(ObservableCollection<BlockDesignerItemViewModel> children, bool self)
|
||||
{
|
||||
List<BlockItemsContainerInfo> itemsContainers = new List<BlockItemsContainerInfo>();
|
||||
if (self)
|
||||
@@ -264,7 +264,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
foreach (var container in item.Containers)
|
||||
{
|
||||
itemsContainers.Add(container);
|
||||
itemsContainers.AddRange(container.GetAllContain(container.Children, false));
|
||||
itemsContainers.AddRange(container.GetAllContainers(container.Children, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3221,7 +3221,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
if (port.GetBounds().IntersectsWith(blockDesignerItemViewModel.GetBounds())) //如果两个位置相交
|
||||
{
|
||||
var innerport = port.GetAllContain(port.Children, false).Where(p => p.GetBounds().IntersectsWith(blockDesignerItemViewModel.GetBounds())).OrderByDescending(p => p.ContainerLevel).FirstOrDefault();
|
||||
var innerport = port.GetAllContainers(port.Children, false).Where(p => p.GetBounds().IntersectsWith(blockDesignerItemViewModel.GetBounds())).OrderByDescending(p => p.ContainerLevel).FirstOrDefault();
|
||||
if (innerport != null)
|
||||
{
|
||||
innerport.DataItem.ShowConnectors = true;
|
||||
@@ -3356,7 +3356,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
if (port.GetBounds().IntersectsWith(blockDesignerItemTempLink.GetBounds())) //如果两个位置相交
|
||||
{
|
||||
var innerport = port.GetAllContain(port.Children, false).Where(p => p.GetBounds().IntersectsWith(blockDesignerItemTempLink.GetBounds())).OrderByDescending(p => p.ContainerLevel).FirstOrDefault();
|
||||
var innerport = port.GetAllContainers(port.Children, false).Where(p => p.GetBounds().IntersectsWith(blockDesignerItemTempLink.GetBounds())).OrderByDescending(p => p.ContainerLevel).FirstOrDefault();
|
||||
if (innerport != null)
|
||||
{
|
||||
innerport.DataItem.ShowConnectors = true;
|
||||
@@ -3403,7 +3403,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public void ClearNearContain()
|
||||
{
|
||||
Items.OfType<BlockDesignerItemViewModel>().ToList().SelectMany(n => n.GetAllContain()).Where(p => p.BeAttachTo == true || p.DisableAttachTo == true).ToList()
|
||||
Items.OfType<BlockDesignerItemViewModel>().ToList().SelectMany(n => n.GetAllContainers()).Where(p => p.BeAttachTo == true || p.DisableAttachTo == true).ToList()
|
||||
.ForEach(p => {
|
||||
p.DisableAttachTo = false;
|
||||
p.BeAttachTo = false;
|
||||
|
||||
Reference in New Issue
Block a user