Hi,
Thanks for the tips.
I am having 2 challenges.
If I use AttachTo while I am creating the shapes, I get the result shown in the attached screenshot.
The 3 blue circles should be located at the BottomRight of the shapes to their left.
If I wait until after I have called the "arrange" method, I call the following functions:
protected void getAnnotations(Diagram diagram)
{
Factory factory = diagram.Factory;
DiagramNodeCollection allNodes = diagram.Nodes;
foreach (ShapeNode node in allNodes)
{
if (node.Shape == Shapes.RoundRect) // A task shape
{
// Attach an annotation node - POC
ShapeNode annotationNode = factory.CreateShapeNode(0, 0, 3, 3, Shapes.Ellipse);
MindFusion.Drawing.SolidBrush annotationShapeFill = new MindFusion.Drawing.SolidBrush(Color.Navy);
annotationNode.Brush = annotationShapeFill;
annotationNode.Tag = "annotation";
annotationNode.ToolTip = "This is an annotation";
//annotationNode.Transparent = true;
AttachToParent(diagram, annotationNode, node.Id);
}
}
}
protected void AttachToParent(Diagram diagram, ShapeNode childNode, Object parentID)
{
DiagramNode parent = diagram.FindNodeById(parentID);
childNode.AttachTo(parent, AttachToNode.BottomRight);
}
This results in the following exception:
"Collection was modified; enumeration operation may not execute."
Any suggestions as to how to proceed? When exactly should I be executing the AttachTo method?
Thanks
Jim