Method JSettings.Load
Overload
Loads a JSON file and deserializes to an object of type T, or creates a new object of type T.
protected static T Load<T>(string file, bool useDefault = false, bool? useDefaultOnError = true, JsonSerializerOptions jsOpt = null) where T : JSettings
Parameters
|
file (string)
Full path of |
|
useDefault (bool)
Use default settings. Don't load from file. Delete file if exists. |
|
useDefaultOnError (bool?)
What to do if failed to load or parse the file: |
|
jsOpt (JsonSerializerOptions)
Options for deserializing and serializing. If |
Returns
|
T
Object of type |
Exceptions
|
ArgumentException
Not full path. |
|
NotSupportedException
Field type not supported by System.Text.Json.JsonSerializer. |
Type Parameters
| T |