Nucs / JsonSettings

This library simplifies creating configuration for your C# app/service by utilizing the serialization capabilities of Json.NET to serialize nested (custom) objects, dictionaries and lists as simply as by creating a POCO and inheriting JsonSettings class.
MIT License
76 stars 18 forks source link

Autosave in hardcoded Setting file #6

Closed ghost1372 closed 6 years ago

ghost1372 commented 6 years ago

is it possible to use auto save method in hardcoded mode?

Nucs commented 6 years ago

As the Readme.md says, "note: can be applied only to dynamic settings. proxy-classes are not .net-wide yet."

I wrote that quite long time ago and now it seems that there is a support with DynamicProxy in CastleProject. I'll work that on the weekend and release it as 1.1.0, thanks for the suggestion.

Nucs commented 6 years ago

Added and uploaded to version 1.0.7 and 1.0.0 of Nucs.JsonSettings.Autosave in nuget. Example:

var x = JsonSettings.Load<Settings>().EnableAutosave();
//or
var x = JsonSettings.Load<Settings>().EnableIAutosave<ISettings>(); //Settings implements interface ISettings
x.Property = "abc"; //saved.

Remarks:

I will soon add a new page to wiki.