SetItIn.Xml 0.4.0

A very simple and straightforward way of working with user and application settings in .NET using XML

Install-Package SetItIn.Xml -Version 0.4.0
dotnet add package SetItIn.Xml --version 0.4.0
<PackageReference Include="SetItIn.Xml" Version="0.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SetItIn.Xml --version 0.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Set it in!

A very simple and straightforward way of working with user and application settings in .NET

Access, create, and persist user and application settings at run time using the following implementations:

  • Memory Settings
  • JSON Settings
  • XML Settngs

Targets .NET Standard 1.3

Installation

For XML:

Install-Package SetItIn.Xml

For JSON:

Install-Package SetItIn.Json

Usage example

var localAppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
var jsonFile = Path.Combine(appDataFolder, "MyApp", "MySettings.json");

ISettings settings = new JsonSettings(jsonFile);

settings.Set("Chuck", "Norris");
settings.Set("Walker, Texas Ranger episodes", 201);
settings.Set("Can Chuck Norris divide by zero?", true);

if (settings.Get("Walker, Texas Ranger episodes", out int episodes))
    Console.WriteLine($"8 seasons and {episodes} episodes.");

Don't forget to save the settings

settings.Save();

Load them from the file at any time

settings.Load();

It does work with reference types as well

public class UserSetting
{
    public string Value1 { get; set; }
    public string Value2 { get; set; }
}

settings.Set("MySetting", new UserSetting { Value1 = "A", Value2 = "B" });

// ... save it on shutdown
settings.Save();

// ... load it on startup
settings.Load();

if (settings.Get("MySetting", out UserSetting mySetting))
    // do something with it

Contributing

  1. Fork it (https://github.com/dkjazz/SetItIn)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am &#39;Add some fooBar&#39;)
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Set it in!

A very simple and straightforward way of working with user and application settings in .NET

Access, create, and persist user and application settings at run time using the following implementations:

  • Memory Settings
  • JSON Settings
  • XML Settngs

Targets .NET Standard 1.3

Installation

For XML:

Install-Package SetItIn.Xml

For JSON:

Install-Package SetItIn.Json

Usage example

var localAppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
var jsonFile = Path.Combine(appDataFolder, "MyApp", "MySettings.json");

ISettings settings = new JsonSettings(jsonFile);

settings.Set("Chuck", "Norris");
settings.Set("Walker, Texas Ranger episodes", 201);
settings.Set("Can Chuck Norris divide by zero?", true);

if (settings.Get("Walker, Texas Ranger episodes", out int episodes))
    Console.WriteLine($"8 seasons and {episodes} episodes.");

Don't forget to save the settings

settings.Save();

Load them from the file at any time

settings.Load();

It does work with reference types as well

public class UserSetting
{
    public string Value1 { get; set; }
    public string Value2 { get; set; }
}

settings.Set("MySetting", new UserSetting { Value1 = "A", Value2 = "B" });

// ... save it on shutdown
settings.Save();

// ... load it on startup
settings.Load();

if (settings.Get("MySetting", out UserSetting mySetting))
    // do something with it

Contributing

  1. Fork it (https://github.com/dkjazz/SetItIn)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am &#39;Add some fooBar&#39;)
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

  • .NETStandard 2.0

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.4.0 56 8/19/2019
0.3.0 57 8/13/2019