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) 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: |
Returns
T
An object of type T. Just creates a new object if the file does not exist or failed to load or parse (invalid JSON) or useDefault |
Exceptions
ArgumentException
Not full path. |
NotSupportedException
Field type not supported by JsonSerializer. |
Type Parameters
T |