mirror of
https://github.com/builtbybel/FluentCleaner.git
synced 2026-09-16 14:27:02 +00:00
28 lines
889 B
C#
28 lines
889 B
C#
namespace FluentCleaner.Models;
|
|
|
|
/* Parsed representation of one RegKeyN= line from Winapp2.ini.
|
|
Format: RegKey1=<HIVE\SubKey>[|ValueName]
|
|
Without a ValueName the entire key tree is deleted; with one only that value is removed. */
|
|
public class RegKeyEntry
|
|
{
|
|
// Full registry path including hive, e.g. "HKCU\Software\Microsoft\Foo".
|
|
public string KeyPath { get; set; } = "";
|
|
|
|
// Optional. If set, only this named value is deleted rather than the whole key.
|
|
public string? ValueName { get; set; }
|
|
|
|
public static RegKeyEntry Parse(string value)
|
|
{
|
|
var idx = value.IndexOf('|');
|
|
if (idx >= 0)
|
|
{
|
|
return new RegKeyEntry
|
|
{
|
|
KeyPath = value[..idx].Trim(),
|
|
ValueName = value[(idx + 1)..].Trim()
|
|
};
|
|
}
|
|
return new RegKeyEntry { KeyPath = value.Trim() };
|
|
}
|
|
}
|