Deleting elements which are not used on a diagram results in error (#423)
Steps to repeat:
- Open model with at least one element that is unused
- Open Element Browser
- Identify an element which is unused (light red background)
- Right-click, Delete the element
This results in the following error:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at SoftwareIdeasModeler.Controls.FastGrid.GridData.UpdateIndexes(Int32 fromIndex)
at SoftwareIdeasModeler.Controls.FastGrid.GridData.RemoveRow(GridRow row)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
OF=SoftwareIdeasModeler.MainForm
LastCmd=SoftwareIdeasModeler.Core.Commands.DeleteFromProjectCommand
OF=DockablePanel.Controls.DockablePanel.FloatingForm
OF=DockablePanel.Controls.DockablePanel.FloatingForm
OF=SoftwareIdeasModeler.Forms.ModelOverviewForm
OF=SoftwareIdeasModeler.Forms.ElementBrowserForm
OF=SoftwareIdeasModeler.Forms.EditorForm