I resolved my question "Option explicit on" myself: it is quite simple, just add one line to the MethodSnippet - and I actually wanted to set "Option strict on" ;-).
I found one more problem: the sample crashes with an ArgumentOutOfRangeException.
To reproduce: I uploaded a video: http://www.hg-online.de/downloads/alternet_codeeditor_exception.zip
1) Switch to "Visual Basic"
2) mark the last line of code, press the Backspace key to delete it.
3) press "Backspace" once again => the exception occurs.
System.ArgumentOutOfRangeException occurred
HResult=0x80131502
Message=Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen.
Parametername: length
Source=mscorlib
StackTrace:
at System.String.Substring(Int32 startIndex, Int32 length)
at Alternet.Editor.Selection.SmartSetSelectedText(String text, SelectionType selType)
at Alternet.Editor.Selection.UndoOperations(ITextUndoList operations, Boolean withUndo)
at Alternet.Editor.Selection.SmartFormat(Boolean needFormat, Boolean notify, Boolean needIndent, Boolean jumptoEnd, Boolean extended, Int32 line)
at Alternet.Editor.Selection.SmartFormat(Int32 line)
at Alternet.Editor.SyntaxEdit.Notification(Object sender, EventArgs e)
at Alternet.Editor.TextSource.TextSource.Notify(EventArgs e)
at Alternet.Editor.TextSource.TextSource.Update()
at Alternet.Editor.TextSource.TextSource.EndUpdate()
at Alternet.Editor.Selection.DeleteLeft(Boolean deleteWord)
at Alternet.Editor.Selection.DeleteLeft()
at Alternet.Editor.EventHandlers.DeleteLeft()
at Alternet.Editor.KeyList.ExecuteKey(Keys keys, Int32& state)
at Alternet.Editor.SyntaxEdit.ProcessKey(Keys keyData)
at Alternet.Editor.SyntaxEdit.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Alternet.Editor.SyntaxEdit.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr 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 SnippetsParsers.Program.Main() in C:\Temp\SnippetsParsers_WinForms\Program.cs:line 32
Best regards
Wolfgang