Posted 19 years ago
by Ashton
-
Developer,
Schema Solutions LLC
I am getting the following exception:
"Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
At the following stack trace:
at System.Collections.ArrayList.get_Item(Int32 index)
at ActiproSoftware.SyntaxEditor.TokenCollection.get_Item(Int32 index)
at ActiproSoftware.SyntaxEditor.BracketHighlighting._2()
at ActiproSoftware.SyntaxEditor.EditorView._1(Object , SelectionEventArgs )
at ActiproSoftware.SyntaxEditor.Selection._1(SelectionEventArgs )
at ActiproSoftware.SyntaxEditor.Selection._1(Boolean )
at ActiproSoftware.SyntaxEditor.Selection._1(DocumentModificationEventArgs )
at ActiproSoftware.SyntaxEditor.SyntaxEditor._2(Object , DocumentModificationEventArgs )
at ActiproSoftware.SyntaxEditor.Document._1(DocumentModificationEventArgs )
at ActiproSoftware.SyntaxEditor.Document._2(DocumentModificationEventArgs )
at ActiproSoftware.SyntaxEditor.Document._1(DocumentModification )
at ActiproSoftware.SyntaxEditor.Document._1(DocumentModificationType , Int32 , Int32 , String )
at ActiproSoftware.SyntaxEditor.Document.UndoableInsert(DocumentModificationType type, Int32 offset, Int32 length, String text)
at ActiproSoftware.SyntaxEditor.EditorView._1(DocumentModificationType , String )
at ActiproSoftware.SyntaxEditor.EditorView._1(String
at ActiproSoftware.SyntaxEditor.EditorView.InsertText(String text)
at MYCODE
I am passing the following text to InsertText
"123 ashton\r\nselect\r\n"
ie.
editor.SelectedView.InsertText("123 ashton\r\nselect\r\n");
The only thing that might have been different wasa that I had just split the editor into 2 panes (one on top of the other) and the selected view was probably in the bottom pane. I also had made the following call immediately before doing the InsertText:
this.editor.SelectedView.Selection.SelectAll();
But other than it being 2 panes and doing a select all, all I was doing was calling InsertText so I'm not sure why I was getting this exception.
Also, in case it helps, this was the text before I did the SelectAll and then the InsertText:
"123\nashton\nSELECT\n\t\n"
Thanks,
Ashton
"Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
At the following stack trace:
at System.Collections.ArrayList.get_Item(Int32 index)
at ActiproSoftware.SyntaxEditor.TokenCollection.get_Item(Int32 index)
at ActiproSoftware.SyntaxEditor.BracketHighlighting._2()
at ActiproSoftware.SyntaxEditor.EditorView._1(Object , SelectionEventArgs )
at ActiproSoftware.SyntaxEditor.Selection._1(SelectionEventArgs )
at ActiproSoftware.SyntaxEditor.Selection._1(Boolean )
at ActiproSoftware.SyntaxEditor.Selection._1(DocumentModificationEventArgs )
at ActiproSoftware.SyntaxEditor.SyntaxEditor._2(Object , DocumentModificationEventArgs )
at ActiproSoftware.SyntaxEditor.Document._1(DocumentModificationEventArgs )
at ActiproSoftware.SyntaxEditor.Document._2(DocumentModificationEventArgs )
at ActiproSoftware.SyntaxEditor.Document._1(DocumentModification )
at ActiproSoftware.SyntaxEditor.Document._1(DocumentModificationType , Int32 , Int32 , String )
at ActiproSoftware.SyntaxEditor.Document.UndoableInsert(DocumentModificationType type, Int32 offset, Int32 length, String text)
at ActiproSoftware.SyntaxEditor.EditorView._1(DocumentModificationType , String )
at ActiproSoftware.SyntaxEditor.EditorView._1(String
at ActiproSoftware.SyntaxEditor.EditorView.InsertText(String text)
at MYCODE
I am passing the following text to InsertText
"123 ashton\r\nselect\r\n"
ie.
editor.SelectedView.InsertText("123 ashton\r\nselect\r\n");
The only thing that might have been different wasa that I had just split the editor into 2 panes (one on top of the other) and the selected view was probably in the bottom pane. I also had made the following call immediately before doing the InsertText:
this.editor.SelectedView.Selection.SelectAll();
But other than it being 2 panes and doing a select all, all I was doing was calling InsertText so I'm not sure why I was getting this exception.
Also, in case it helps, this was the text before I did the SelectAll and then the InsertText:
"123\nashton\nSELECT\n\t\n"
Thanks,
Ashton