File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,16 +51,6 @@ public void ReadPropertiesFromIniSection(IniSection iniSection)
5151 {
5252 continue ;
5353 }
54-
55- if ( ! iniAttribute . WriteIfDefault )
56- {
57- object val = property . GetValue ( this , null ) ;
58- if ( ( val != null && val . Equals ( iniAttribute . DefaultValue ) ) || ( val == null && iniAttribute . DefaultValue == null ) )
59- {
60- iniSection . RemoveKey ( property . Name ) ;
61- continue ;
62- }
63- }
6454 }
6555
6656 if ( propertyType . IsEnum )
@@ -142,6 +132,16 @@ public void WritePropertiesToIniSection(IniSection iniSection)
142132 {
143133 if ( ! iniAttribute . INIDefined )
144134 continue ;
135+
136+ if ( ! iniAttribute . WriteIfDefault )
137+ {
138+ object val = property . GetValue ( this , null ) ;
139+ if ( ( val != null && val . Equals ( iniAttribute . DefaultValue ) ) || ( val == null && iniAttribute . DefaultValue == null ) )
140+ {
141+ iniSection . RemoveKey ( property . Name ) ;
142+ continue ;
143+ }
144+ }
145145 }
146146
147147 if ( propertyType . IsEnum )
You can’t perform that action at this time.
0 commit comments