DoLayoutDiagram() updates the transaction name

For UI Automation support, we have written some test cases which internally access some of the Diagram control function. On button click, pasting the selected nodes at certain location.

public void ButtonClick()
{
	int j = 100;
	for(int i = 0; i<6;i++)
	{
		Paste(new Point(100,j));
		j+=100;
	}
}

private void Paste(object param)
{
    if (myDiagram.CommandHandler.CanPaste())
    {
        var location = (Point)param;
        myDiagram.CommandHandler.Paste();
		myDiagram.Panel.PerformGesture(GestureModifiers.None, Gesture.MouseLeftButton, location, up: location, other: null);
    }
}

Once Pasted, the selected nodes are moved to some location in the diagram. We store the node information in cloud, which will take 2 to 3 seconds to complete, in meantime the DoLayoutDiagram() function replaces the transaction name of CompoundEdit from “MoveSelection” to “Layout” and due to that application is getting crashed. Application works fine if we disable the cloud storage. Please let me know how to restrict the updation of transaction name in UndoRedoManager

The Paste command executes a “Paste” transaction, so I do not see how the code you quoted has anything to do with the situation that you are talking about.

Each paste transaction presumably is adding some Parts to the diagram, which will also perform a layout. That is what causes the nodes to move, but such movement will not take place in a “Moved Selection” transaction. How does saving “node information” to the server matter?

Why do you care what the transaction name is? It’s just meant for debugging and maybe for showing the user what the previous transactions were.