Show / Hide Table of Contents

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) where T : JSettings
Parameters
file  (string)

Full path of .json file. If null, does not load and will not save.

useDefault  (bool)

Use default settings, don't load from file. Delete file if exists.

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 useDefaulttrue. If failed, prints error info in the output.

Type Parameters
T