Skip to content

Commit efb8804

Browse files
903092: concerns addressed
1 parent c245892 commit efb8804

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

blazor/diagram/layout/flowchart-layout.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,21 @@ Any text value can be given as a connector text to describe the flow. Also, any
301301
for (int i = 0; i < Diagram.Connectors.Count; i++)
302302
{
303303
var connector = Diagram.Connectors[i];
304+
var node = Diagram.GetObject(connector.TargetID) as Node;
305+
var srcNode = Diagram.GetObject(connector.SourceID) as Node;
306+
if (node.Data != null && node.Data is ItemInfo itemInfo)
304307
{
305-
var node = Diagram.GetObject(connector.TargetID) as Node;
306-
var srcNode = Diagram.GetObject(connector.SourceID) as Node;
307-
if (node.Data != null && node.Data is ItemInfo itemInfo)
308+
if (itemInfo.Label != null && itemInfo.Label.Count > 0)
308309
{
309-
if (itemInfo.Label != null && itemInfo.Label.Count > 0)
310+
if (itemInfo.ParentId.IndexOf((srcNode.Data as ItemInfo).Id) != -1)
310311
{
311-
if (itemInfo.ParentId.IndexOf((srcNode.Data as ItemInfo).Id) != -1)
312+
var parentIndex = itemInfo.ParentId.IndexOf((srcNode.Data as ItemInfo).Id);
313+
if (itemInfo.Label.Count > parentIndex)
312314
{
313-
var parentIndex = itemInfo.ParentId.IndexOf((srcNode.Data as ItemInfo).Id);
314-
if (itemInfo.Label.Count > parentIndex)
315+
connector.Annotations = new DiagramObjectCollection<PathAnnotation>()
315316
{
316-
connector.Annotations = new DiagramObjectCollection<PathAnnotation>()
317-
{
318-
new PathAnnotation() { Content = itemInfo.Label[parentIndex], Style = new TextStyle(){ Bold = true} }
319-
};
320-
}
317+
new PathAnnotation() { Content = itemInfo.Label[parentIndex], Style = new TextStyle(){ Bold = true} }
318+
};
321319
}
322320
}
323321
}

0 commit comments

Comments
 (0)