@@ -233,9 +233,9 @@ public bool TryGet<T>(string section, string key, out T value)
233
233
if ( ret )
234
234
{
235
235
if ( value is float )
236
- value = ( T ) ( object ) sect . GetFloat ( key ) ;
236
+ value = ( T ) ( object ) sect . TryGetFloat ( key ) ;
237
237
else if ( value is int )
238
- value = ( T ) ( object ) sect . GetInt ( key ) ;
238
+ value = ( T ) ( object ) sect . TryGetInt ( key ) ;
239
239
else
240
240
value = ( T ) ( object ) sect . GetString ( key ) ;
241
241
}
@@ -249,12 +249,12 @@ public string GetString(string section, string key)
249
249
250
250
public float GetFloat ( string section , string key )
251
251
{
252
- return sections [ section ] . GetFloat ( key ) ;
252
+ return sections [ section ] . TryGetFloat ( key ) ;
253
253
}
254
254
255
255
public int GetInt ( string section , string key )
256
256
{
257
- return sections [ section ] . GetInt ( key ) ;
257
+ return sections [ section ] . TryGetInt ( key ) ;
258
258
}
259
259
260
260
public void Set < T > ( string section , string key , T value )
@@ -317,15 +317,15 @@ public string GetString(string key)
317
317
return this [ key ] . First ( ) ;
318
318
}
319
319
320
- public int GetInt ( string key )
320
+ public int TryGetInt ( string key )
321
321
{
322
322
var value = TryGetString ( key ) ;
323
323
int result = 0 ;
324
324
int . TryParse ( value , out result ) ;
325
325
return result ;
326
326
}
327
327
328
- public float GetFloat ( string key )
328
+ public float TryGetFloat ( string key )
329
329
{
330
330
var value = TryGetString ( key ) ;
331
331
float result = 0F ;
0 commit comments