Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Unfold/Fold ContainerNode (Read 1345 times)
Novice
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Apr 19th, 2011
Unfold/Fold ContainerNode
Apr 28th, 2011 at 11:39am
Print Post  
Hi

When the user clicks on a ContainerNode to fold/unfold I run a method to shift other ContainerNodes so that they are not eg overlapped by an unfolded ContainerNode.

These operations are caught as different actions by the undomanager (as is expected) but I would like to enable the user to undo them as a single composite action.

Please can you suggest an approach I might take to achieve this.

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Unfold/Fold ContainerNode
Reply #1 - Apr 28th, 2011 at 12:10pm
Print Post  
Hi,

Try merging the undo records, using intermediate composite command to avoid counting the node modification ones:
Code
Select All
private void diagram_ContainerFolded(object sender, NodeEventArgs e)
{
	CompositeCmd cmd = diagram.UndoManager.StartComposite("");

	// shift nodes
	...
	cmd.Execute();
	diagram.UndoManager.History.MergeUndoRecords(2, "Fold container");
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint