File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,13 @@ public List<IniSectionDataItem> GetData(string filePath)
2525 return [ ] ;
2626 }
2727
28- // Get sections
29- var sections = lines
30- . Where ( line => line . StartsWith ( '[' ) && line . EndsWith ( ']' ) ) ;
31-
32- // Get section line indexes
28+ // Get section line indexes directly to handle duplicate section names
3329 List < int > sectionLineIndexes = [ ] ;
34- foreach ( var section in sections )
35- sectionLineIndexes . Add ( lines . IndexOf ( section ) ) ;
30+ for ( int i = 0 ; i < lines . Count ; i ++ )
31+ {
32+ if ( lines [ i ] . StartsWith ( '[' ) && lines [ i ] . EndsWith ( ']' ) )
33+ sectionLineIndexes . Add ( i ) ;
34+ }
3635
3736 List < IniSectionDataItem > dataItems = [ ] ;
3837
@@ -42,10 +41,10 @@ public List<IniSectionDataItem> GetData(string filePath)
4241
4342 var count =
4443 index + 1 == sectionLineIndexes . Count
45- ? ( lines . Count - 1 ) - sectionIndex
46- : sectionLineIndexes [ index + 1 ] - sectionIndex ;
44+ ? lines . Count - sectionIndex - 1
45+ : sectionLineIndexes [ index + 1 ] - sectionIndex - 1 ;
4746
48- if ( count = = 0 )
47+ if ( count < = 0 )
4948 continue ;
5049
5150 var range = lines . GetRange ( sectionIndex + 1 , count ) ;
Original file line number Diff line number Diff line change 4949 </Grid .RowDefinitions>
5050
5151 <Image
52- Grid.RowSpan=" 2 "
52+ Grid.RowSpan=" 3 "
5353 HorizontalAlignment=" {x:Bind ShellViewModel.FolderBackgroundImageHorizontalAlignment, Mode=OneWay}"
5454 VerticalAlignment=" {x:Bind ShellViewModel.FolderBackgroundImageVerticalAlignment, Mode=OneWay}"
5555 Opacity=" {x:Bind ShellViewModel.FolderBackgroundImageOpacity, Mode=OneWay}"
You can’t perform that action at this time.
0 commit comments