Added code to handle collection was modified error when copying items

Added code to make F5 and Shift-F5 keystrokes in the editor work identical to the right mouse button context menu of the tree view with regards to copy and paste of items
Added code to assure only items of similar type (eg: procedure, section, high level step, etc) can be copied and pasted at similar locations within a procedure or working draft
This commit is contained in:
Rich
2014-08-28 02:41:23 +00:00
parent 1baf690bc6
commit f9de5305f2
3 changed files with 125 additions and 41 deletions

View File

@@ -2033,8 +2033,19 @@ namespace Volian.Controls.Library
if (e.Shift)
{
e.Handled = true;
if (!OnCheckClipboard(this, new EventArgs())) return; // check if 'clipboard' contains a step.
OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste"));
ItemInfo myCopyStep = (this.Parent.Parent.Parent as StepTabPanel).MyDisplayTabControl.MyCopyStep;
if (myCopyStep != null)
{
if (this.MyItemInfo.IsSection && myCopyStep.IsSection)
OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste"));
if (this.MyItemInfo.IsStep && myCopyStep.IsStep)
{
if ((this.MyItemInfo.IsHigh && myCopyStep.IsHigh) || (!this.MyItemInfo.IsHigh && !myCopyStep.IsHigh))
OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste"));
}
}
//if (!OnCheckClipboard(this, new EventArgs())) return; // check if 'clipboard' contains a step.
//OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste"));
}
else if (!e.Control && !e.Alt)
{