Edit the shape display order
Bring a shape to the front
To bring a shape to the front, use the BringToFront
method of the IShape
object.
public void BringToFront(ICommandContext c, ICommandParams p)
{
//Get the currently displayed diagram.
IDiagram diagram = c.App.Workspace.CurrentEditor as IDiagram;
if (diagram == null)
{
//If no diagram is displayed, exit.
return;
}
//Get the node shape selected on the diagram.
INode node = diagram.GetSelectedShapes().OfType<INode>().FirstOrDefault();
if (node == null)
{
//If no node shape is selected, exit.
return;
}
//Bring the shape to the front.
node.BringToFront();
}
info
If you want to bring a shape one step forward from the current display, use the BringForward
method of the IShape
object.