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