Not sure how you want this (or if you want it) but I leave that up to you to sort out.
I had created several buttons on a form and was double-clicking them one at a time to auto-create the necessary code for them.
This error ocurred when I double-clicked one of them. The error log is as follows:
SharpDevelop Version : 2.2.0.2595
.NET Version : 2.0.50727.832
OS Version : Microsoft Windows NT 5.1.2600 Service Pack 2
Current culture : Swedish (Sweden) (sv-SE)
Current UI language : en-US
Working Set Memory : 83108kb
GC Heap Memory : 19988kb
Unhandled exception terminated the workbench
Exception thrown:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
at System.String.CtorCharArrayStartLength(Char[] value, Int32 startIndex, Int32 length)
at ICSharpCode.TextEditor.Document.GapTextBufferStrategy.GetText(Int32 offset, Int32 length)
at ICSharpCode.TextEditor.Document.DefaultDocument.GetText(Int32 offset, Int32 length)
at ICSharpCode.FormsDesigner.CSharpDesignerGenerator.GetCursorLine(IDocument document, IMethod method)
at ICSharpCode.FormsDesigner.AbstractDesignerGenerator.InsertComponentEvent(IComponent component, EventDescriptor edesc, String eventMethodName, String body, String& file, Int32& position)
at ICSharpCode.FormsDesigner.FormsDesignerViewContent.ShowSourceCode(IComponent component, EventDescriptor edesc, String eventMethodName)
at ICSharpCode.FormsDesigner.Services.EventBindingService.ShowCode(IComponent component, EventDescriptor edesc, String methodName)
at System.ComponentModel.Design.EventBindingService.ShowCodeIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ICSharpCode.SharpDevelop.Commands.StartWorkbenchCommand.Run(IList`1 fileList)
at ICSharpCode.SharpDevelop.Sda.CallHelper.RunWorkbenchInternal(Object settings)
BTW, just a couple of minutes prior to this error I had to terminate SharpDevelop as it stopped responding to me (even though XP said it was still running fine)