Table of Contents

Namespace Nucs.JsonSettings

The primary Nucs.JsonSettings namespace — the JsonSettings base class, the dynamic SettingsBag, savable interfaces, and the library's exception types.

This is where you start when writing Nucs.JsonSettings code:

  • JsonSettings is the abstract base class you inherit for a typed, hardcoded settings object. Creation and loading go through its static API (Load, Construct, Configure); saving goes through the instance (Save).
  • SettingsBag is a ready-made dynamic key/value settings object when you would rather not declare a class.
  • ISavable and IEncryptedSavable are the savable contracts.

Optional behavior — encryption, Base64, versioning, recovery and autosave — is added per object as modules; see the Nucs.JsonSettings.Modulation namespace and the FluentJsonSettings fluent extensions in this namespace.

using Nucs.JsonSettings;

class MySettings : JsonSettings {
    public override string FileName { get; set; } = "config.json";
    public string Name { get; set; } = "default";
}

var settings = JsonSettings.Load<MySettings>("config.json");
settings.Name = "ok";
settings.Save();

Classes

Activation
DynamicSettingsBag

A dynamic wrapper to a SettingsBag.

Files
FluentJsonSettings
JsonSettings
JsonSettingsException
NotifiyingJsonSettings

A JsonSettings that implements INotifyPropertyChanged and INotifyPropertyChanging.

ReflectiveException
SettingsBag

A dynamic settings class, adds settings as you go.

Interfaces

IEncryptedSavable
ISavable
ModulesLoader

A class that uses modules.

Enums

EncryptionAlgorithm

Selects the symmetric algorithm EncryptionModule uses. Every algorithm is provided by the .NET base class library (System.Security.Cryptography); no third-party crypto is involved.

KeySize

AES key sizes, in bits. Selects the AES variant for every AES-based EncryptionAlgorithm (CBC, CBC-HMAC, GCM, CCM).

Delegates

AfterDecryptHandler
AfterDeserializeHandler
AfterEncryptHandler
AfterLoadHandler
AfterRepopulateHandler
AfterSaveHandler
AfterSerializeHandler
BeforeDeserializeHandler
BeforeLoadHandler
BeforeRepopulateHandler
BeforeSaveHandler
BeforeSerializeHandler
ConfigurateHandler
DecryptHandler
EncryptHandler
RecoveredHandler
TryingRecoverHandler