IniToolsSharp 1.0.2
dotnet add package IniToolsSharp --version 1.0.2
NuGet\Install-Package IniToolsSharp -Version 1.0.2
<PackageReference Include="IniToolsSharp" Version="1.0.2" />
<PackageVersion Include="IniToolsSharp" Version="1.0.2" />
<PackageReference Include="IniToolsSharp" />
paket add IniToolsSharp --version 1.0.2
#r "nuget: IniToolsSharp, 1.0.2"
#:package IniToolsSharp@1.0.2
#addin nuget:?package=IniToolsSharp&version=1.0.2
#tool nuget:?package=IniToolsSharp&version=1.0.2
<p align="center"> <img src="https://github.com/kris701/IniToolsSharp/assets/22596587/058e2a34-1864-46e9-868c-cc94d6ae11d7" width="200" height="200" /> </p>
INI Tools Sharp is a little project to manipulate and output INI files. You can find it on the NuGet Package Manager or the GitHub Package Manager.
How to Use
The package is inspired by that of System.Text.Json, where you can access two primary static methods, INISerialiser.Deserialise
and INISerialiser.Serialise
to convert generic classes into INI format and back.
A class represents a section by giving it a IniSectionAttribute
and a name.
Example
Test class to work with:
public class Section1
{
public bool Value1 { get; set; } = false;
public int Value2 { get; set; } = -1;
}
public class SomeSettings
{
[IniSection("SectionName")]
public Section1 Section { get; set; } = new Section1();
}
You can then serialise it into a INI file format:
var text = IniSerialiser.Serialise(new SomeSettings());
This will output text as follows:
[SectionName]
Value1=False
Value2=-1
The same text can be deserialised back into the SomeSettings
object.
Example
You can also use simple list types as follows:
public class Section1
{
public List<int> Values { get; set; } = new List<int>()
{
5,
123,
-1
}
}
public class SomeSettings
{
[IniSection("SectionName")]
public Section1 Section { get; set; } = new Section1();
}
You can then serialise it into a INI file format:
var text = IniSerialiser.Serialise(new SomeSettings());
This will output text as follows:
[SectionName]
Values=[5,123,-1]
The same text can be deserialised back into the SomeSettings
object.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.