@@ -17,7 +17,7 @@ public partial class FindReplaceWindow
1717 {
1818 #region Variables
1919 private EditorElement _editor ;
20- private EditorElement [ ] _allEditors ;
20+ private List < EditorElement > _allEditors ;
2121 private LayoutDocumentPane _dockingPane ;
2222 private bool IsSearchFieldOpen ;
2323 private readonly string Selection ;
@@ -228,17 +228,17 @@ private void Search()
228228 LoadEditorsInfo ( ) ;
229229 var editors = GetEditorElementsForFraction ( out var editorIndex ) ;
230230 var regex = GetSearchRegex ( ) ;
231- if ( editors == null || editors . Length < 1 || editors [ 0 ] == null || regex == null )
231+ if ( editors == null || editors . Count < 1 || editors [ 0 ] == null || regex == null )
232232 {
233233 return ;
234234 }
235235
236236 var startFileCaretOffset = 0 ;
237237 var foundOccurence = false ;
238238
239- for ( var i = editorIndex ; i < ( editors . Length + editorIndex + 1 ) ; ++ i )
239+ for ( var i = editorIndex ; i < ( editors . Count + editorIndex + 1 ) ; ++ i )
240240 {
241- var index = ValueUnderMap ( i , editors . Length ) ;
241+ var index = ValueUnderMap ( i , editors . Count ) ;
242242 string searchText ;
243243 var addToOffset = 0 ;
244244 if ( i == editorIndex )
@@ -248,7 +248,7 @@ private void Search()
248248 if ( startFileCaretOffset < 0 ) { startFileCaretOffset = 0 ; }
249249 searchText = editors [ index ] . editor . Text . Substring ( startFileCaretOffset ) ;
250250 }
251- else if ( i == ( editors . Length + editorIndex ) )
251+ else if ( i == ( editors . Count + editorIndex ) )
252252 {
253253 searchText = startFileCaretOffset == 0 ?
254254 string . Empty :
@@ -286,17 +286,17 @@ private void Replace()
286286 LoadEditorsInfo ( ) ;
287287 var editors = GetEditorElementsForFraction ( out var editorIndex ) ;
288288 var regex = GetSearchRegex ( ) ;
289- if ( editors == null || editors . Length < 1 || editors [ 0 ] == null || regex == null )
289+ if ( editors == null || editors . Count < 1 || editors [ 0 ] == null || regex == null )
290290 {
291291 return ;
292292 }
293293
294294 var replaceString = ReplaceBox . Text ;
295295 var startFileCaretOffset = 0 ;
296296 var foundOccurence = false ;
297- for ( var i = editorIndex ; i < ( editors . Length + editorIndex + 1 ) ; ++ i )
297+ for ( var i = editorIndex ; i < ( editors . Count + editorIndex + 1 ) ; ++ i )
298298 {
299- var index = ValueUnderMap ( i , editors . Length ) ;
299+ var index = ValueUnderMap ( i , editors . Count ) ;
300300 string searchText ;
301301 var addToOffset = 0 ;
302302 if ( i == editorIndex )
@@ -306,7 +306,7 @@ private void Replace()
306306 if ( startFileCaretOffset < 0 ) { startFileCaretOffset = 0 ; }
307307 searchText = editors [ index ] . editor . Text . Substring ( startFileCaretOffset ) ;
308308 }
309- else if ( i == ( editors . Length + editorIndex ) )
309+ else if ( i == ( editors . Count + editorIndex ) )
310310 {
311311 searchText = startFileCaretOffset == 0 ?
312312 string . Empty :
@@ -345,7 +345,7 @@ private void ReplaceAll()
345345 LoadEditorsInfo ( ) ;
346346 var editors = GetEditorElementsForFraction ( out _ ) ;
347347 var regex = GetSearchRegex ( ) ;
348- if ( editors == null || editors . Length < 1 || editors [ 0 ] == null || regex == null )
348+ if ( editors == null || editors . Count < 1 || editors [ 0 ] == null || regex == null )
349349 {
350350 return ;
351351 }
@@ -380,7 +380,7 @@ private void Count()
380380 LoadEditorsInfo ( ) ;
381381 var editors = GetEditorElementsForFraction ( out _ ) ;
382382 if ( editors == null ) { return ; }
383- if ( editors . Length < 1 ) { return ; }
383+ if ( editors . Count < 1 ) { return ; }
384384 if ( editors [ 0 ] == null ) { return ; }
385385 var regex = GetSearchRegex ( ) ;
386386 if ( regex == null ) { return ; }
@@ -454,20 +454,20 @@ private Regex GetSearchRegex()
454454 return regex ;
455455 }
456456
457- private EditorElement [ ] GetEditorElementsForFraction ( out int editorIndex )
457+ private List < EditorElement > GetEditorElementsForFraction ( out int editorIndex )
458458 {
459459 LoadEditorsInfo ( ) ;
460460 var editorStartIndex = 0 ;
461- EditorElement [ ] editors ;
461+ List < EditorElement > editors ;
462462 if ( FindDestinies . SelectedIndex == 0 )
463- { editors = new [ ] { _editor } ; }
463+ { editors = new ( ) { _editor } ; }
464464 else
465465 {
466466 editors = _allEditors ;
467467 var checkElement = _dockingPane . SelectedContent ? . Content ;
468468 if ( checkElement is EditorElement )
469469 {
470- for ( var i = 0 ; i < editors . Length ; ++ i )
470+ for ( var i = 0 ; i < editors . Count ; ++ i )
471471 {
472472 if ( editors [ i ] == checkElement )
473473 {
0 commit comments