ChaseLabs.Configuration
0.2.0
dotnet add package ChaseLabs.Configuration --version 0.2.0
NuGet\Install-Package ChaseLabs.Configuration -Version 0.2.0
<PackageReference Include="ChaseLabs.Configuration" Version="0.2.0" />
paket add ChaseLabs.Configuration --version 0.2.0
#r "nuget: ChaseLabs.Configuration, 0.2.0"
// Install ChaseLabs.Configuration as a Cake Addin #addin nuget:?package=ChaseLabs.Configuration&version=0.2.0 // Install ChaseLabs.Configuration as a Cake Tool #tool nuget:?package=ChaseLabs.Configuration&version=0.2.0
Chase Labs Configuration Utility
This is a C# Config Manager Utility that allows easy config creation and use.
To Install<br>
with Package Manager<br>
Install-Package ChaseLabs.Configuration
<br>
with Nuget Manager<br>
ChaseLabs.Configuration
and Download Latest
For Sample Code Visit WIKI
Getting Started
Config is saved as JSON and is constantly stored in memory. See Low Memory Config Manager for more information.
public ConfigManager Manager;
public void HandleConfig()
{
// Saves config to /Path/To/Config/ConfigFileName.json
Manager = new ConfigManager("ConfigFileName", "/Path/To/Config");
// Change save rate every 5 seconds
Manager = new ConfigManager([...], [...], 5000)
}
Getting Config Rule
Use the Method GetOrCreate([name], [default value])
to get the specified config value or have it created.
public string StringConfig = Manager.GetOrCreate("a string key", "default value").Value;
public bool BooleanConfig = Manager.GetOrCreate("a bool key", false).Value;
public float FloatConfig = Manager.GetOrCreate("a float key", 0.0f).Value;
public int IntConfig = Manager.GetOrCreate("an int key", 0).Value;
Saving Config Rule
By setting the Config Value Equal to an appropriate value converted to string will automatically write to the config file
Manager.GetOrCreate("a string key", "Default Value").Value = "Hello";
Manager.GetOrCreate("a bool key", false).Value = true;
Manager.GetOrCreate("a float key", 0.0f).Value = 1.5;
Manager.GetOrCreate("an int key", 0).Value = 1;
Low Memory Config
This configuration uses less memory, but is slower to access data. Config Items are stored in individual files and stored as binary instead of JSON
public LowMemoryConfigManager Manager;
public void HandleConfig()
{
// Saves config to /Path/To/Config/ConfigFileName.dat
Manager = new LowMemoryConfigManager("ConfigFileName", "/Path/To/Config");
// Change save rate every 5 seconds
Manager = new LowMemoryConfigManager([...], [...], 5000)
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ChaseLabs.Configuration:
Package | Downloads |
---|---|
ChaseLabs.Updater
An Easy to Use Update Utility |
GitHub repositories
This package is not used by any popular GitHub repositories.
added Low Memory config manager