SelectAll

Hi,

I used Diagram.ClearSelection() to clear all selections in the Diagram. How do you select all nodes and links? I believe in the winforms version there is a SelectAll() function. I tried looping thru all diagram nodes issuing a Select but each Select deselected the previously selected object.

Thanks
Rich

A loop should have worked:

foreach (Node n in myDiagram.Nodes) n.IsSelected = true;
foreach (Link l in myDiagram.Links) l.IsSelected = true;

Or similarly by:

foreach (Node n in myDiagram.Nodes) myDiagram.SelectedParts.Add(n);
foreach (Link l in myDiagram.Links) myDiagram.SelectedParts.Add(l);

Or you could call Diagram.Select:

myDiagram.Select(myDiagram.Nodes.Cast().Concat(myDiagram.Links.Cast()));

But the easiest is to call SelectAll:

myDiagram.CommandHandler.SelectAll();

CommandHandler.SelectAll() is basically implemented by the two loops that I showed first in this reply.