Skip to content

hartl3y94/Ao.SavableConfig

 
 

Repository files navigation

Ao.SavableConfig

.NET CodeQL Github lines Codacy Badge FOSSA Status

What it is

It can two way bind configuration.

The MS configuration provider file -> string map/class properties way to fetch configuration, and the project support string map/class properties -> file way to save the configuration change. And it can dynamic proxy the configuration, it can bind at wpf, xamarin, uwp... When it use configuration UI! And it can auto save, when change the configuration!

And it support proxy setting class, simple modify class property to change properties, and auto save the configuration!

Why it can do that

Can reversal store is i modify the MS configuration lib to make it support, and proxy use MS IL to dynamic create proxy class.

How to use it

The NameTransfer is very import to provider find configuration path!

You can see sample\TwoWayBind

Or wpf project sample\TwoWayBindWpf use in wpf binding

var builder = new SavableConfiurationBuilder();
builder.AddJsonFile("appsettings.json", false, true);
//Make configuration
var root = builder.Build();
//Create proxy and create proxy object
var value = root.AutoCreateProxy<DbConnection>();
root.BindTwoWay(value, JsonChangeTransferCondition.Instance);

After

  1. Add unit test, to conver 100% codes
  2. To make easy use it
  3. Add object <-> string converter like wpf IValueConverter
  4. Add more provider transfer (Now only json)

Nuget

Ao.SavableConfig Ao.SavableConfig.Binder Ao.SavableConfig.Json

License

FOSSA Status

About

Can two way bind configuration

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%