Table of Contents

Class JsonFile

Namespace
Nautilus.Json
Assembly
Nautilus.dll
A simple abstract implementation of IJsonFile.
public abstract class JsonFile : IJsonFile
Inheritance
JsonFile
Implements
Derived
Inherited Members
Extension Methods

Fields

OnFinishedLoading

An event that is invoked whenever the JsonFile has finished loading data from disk.
[JsonIgnore]
public EventHandler<JsonFileEventArgs> OnFinishedLoading

Field Value

EventHandler<JsonFileEventArgs>

OnFinishedSaving

An event that is invoked whenever the JsonFile has finished saving data to disk.
[JsonIgnore]
public EventHandler<JsonFileEventArgs> OnFinishedSaving

Field Value

EventHandler<JsonFileEventArgs>

OnStartedLoading

An event that is invoked whenever the JsonFile is about to load data from disk.
[JsonIgnore]
public EventHandler<JsonFileEventArgs> OnStartedLoading

Field Value

EventHandler<JsonFileEventArgs>

OnStartedSaving

An event that is invoked whenever the JsonFile is about to save data to disk.
[JsonIgnore]
public EventHandler<JsonFileEventArgs> OnStartedSaving

Field Value

EventHandler<JsonFileEventArgs>

Properties

AlwaysIncludedJsonConverters

The Newtonsoft.Json.JsonConverters that should always be used when reading/writing JSON data.
public virtual JsonConverter[] AlwaysIncludedJsonConverters { get; }

Property Value

JsonConverter[]
See Also

JsonFilePath

The file path at which the JSON file is accessible for reading and writing.
[JsonIgnore]
public abstract string JsonFilePath { get; }

Property Value

string

Methods

Load(bool)

Loads the JSON properties from the file on disk into the JsonFile.
public virtual void Load(bool createFileIfNotExist = true)

Parameters

createFileIfNotExist bool
Whether a new JSON file should be created with default values if it does not already exist.
See Also

LoadWithConverters(bool, params JsonConverter[])

Loads the JSON properties from the file on disk into the JsonFile.
public virtual void LoadWithConverters(bool createFileIfNotExist = true, params JsonConverter[] jsonConverters)

Parameters

createFileIfNotExist bool
Whether a new JSON file should be created with default values if it does not already exist.
jsonConverters JsonConverter[]
Optional Newtonsoft.Json.JsonConverters to be used for serialization. The AlwaysIncludedJsonConverters will always be used, regardless of whether you pass them.
See Also

Save()

Saves the current fields and properties of the JsonFile as JSON properties to the file on disk.
public virtual void Save()
See Also

SaveWithConverters(params JsonConverter[])

Saves the current fields and properties of the JsonFile as JSON properties to the file on disk.
public virtual void SaveWithConverters(params JsonConverter[] jsonConverters)

Parameters

jsonConverters JsonConverter[]
Optional Newtonsoft.Json.JsonConverters to be used for deserialization. The AlwaysIncludedJsonConverters will always be used, regardless of whether you pass them.
See Also