SadPencil.Ra2CsfFile
2.1.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SadPencil.Ra2CsfFile --version 2.1.2
NuGet\Install-Package SadPencil.Ra2CsfFile -Version 2.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SadPencil.Ra2CsfFile" Version="2.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SadPencil.Ra2CsfFile" Version="2.1.2" />
<PackageReference Include="SadPencil.Ra2CsfFile" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SadPencil.Ra2CsfFile --version 2.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SadPencil.Ra2CsfFile, 2.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SadPencil.Ra2CsfFile@2.1.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SadPencil.Ra2CsfFile&version=2.1.2
#tool nuget:?package=SadPencil.Ra2CsfFile&version=2.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
This is a .NET Standard 2.0 Library to load, edit, and save string table files (.csf) for Red Alert 2. Also, (de)serialize the string table from/to .ini files.
Example use (also available here):
using SadPencil.Ra2CsfFile;
// New empty string table.
CsfFile csf = new CsfFile();
// Edit labels.
csf.AddLabel("gui:test-label-1", "This is the first line.\nThis is the second line =-;#!");
csf.AddLabel("gui:test-label-2", "Hi there!");
Console.WriteLine(csf.Labels["gui:test-label-2"]);
csf.RemoveLabel("gui:test-label-2");
csf.AddLabel(CsfFile.LowercaseLabelName("GUI:Test-Label-3"), "Invoke CsfFile.LowercaseLabelName() as the label name is case-insensitive.");
// Write as a csf file
string csfFilename = "example.csf";
using (FileStream fs = File.Open(csfFilename, FileMode.Create))
{
csf.WriteCsfFile(fs);
}
// Load csf file
using (FileStream fs = File.Open(csfFilename, FileMode.Open))
{
csf = CsfFile.LoadFromCsfFile(fs);
}
Console.WriteLine($"This csf file has {csf.Labels.Count} labels. The language is {csf.Language}.");
// Save as an ini file
string iniFilename = "example.ini";
using (FileStream fs = File.Open(iniFilename, FileMode.Create))
{
CsfFileIniHelper.WriteIniFile(csf, fs);
}
// Load ini file
using (FileStream fs = File.Open(iniFilename, FileMode.Open))
{
csf = CsfFileIniHelper.LoadFromIniFile(fs);
}
if (csf.Labels["gui:test-label-1"] == "This is the first line.\nThis is the second line =-;#!")
{
Console.WriteLine("Yes. It is expected.");
}
else
{
Console.WriteLine("Unexpected behavior.");
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- ini-parser-netstandard (>= 2.5.2)
- System.Text.Encoding.CodePages (>= 6.0.0)
- System.Text.Encoding.Extensions (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.5 | 278 | 12/14/2025 |
| 2.2.4 | 224 | 10/22/2025 |
| 2.2.3 | 178 | 9/6/2025 |
| 2.2.2 | 216 | 9/5/2025 |
| 2.2.1 | 212 | 8/17/2025 |
| 2.1.3 | 299 | 8/6/2025 |
| 2.1.2 | 545 | 12/25/2021 |
| 2.1.1 | 697 | 12/4/2021 |
| 2.1.0 | 468 | 12/4/2021 |
| 2.0.2 | 490 | 12/4/2021 |
| 2.0.1 | 486 | 12/4/2021 |
| 1.3.1 | 505 | 12/4/2021 |
| 1.2.2 | 458 | 12/4/2021 |
| 1.2.1 | 448 | 12/4/2021 |
| 1.1.1 | 482 | 11/27/2021 |
disable Encoding1252WriteWorkaround by default; add CLSCompliant attribute to namespace SadPencil.Ra2CsfFile