Convert to .NET SDK type csproj

This commit is contained in:
ema
2024-11-30 17:00:22 +08:00
parent e2f1fddb09
commit 507b157a40
83 changed files with 14413 additions and 3386 deletions

View File

@@ -3,37 +3,36 @@ using QuickLook.Common.ExtensionMethods;
using QuickLook.Plugin.VideoViewer.Properties;
using RegFileParser;
namespace QuickLook.Plugin.VideoViewer
namespace QuickLook.Plugin.VideoViewer;
internal static class QLVRegistry
{
internal static class QLVRegistry
internal static void Register()
{
internal static void Register()
{
var obj = new RegFileObject(Resource.QLV);
var obj = new RegFileObject(Resource.QLV);
obj.RegValues.ForEach(k => k.Value.ForEach(k2 => ImportKey(k2.Value)));
}
private static void ImportKey(RegValueObject key)
{
var kind = RegistryValueKind.Unknown;
if (key.Type == "REG_NONE")
kind = RegistryValueKind.None;
else if (key.Type == "REG_SZ")
kind = RegistryValueKind.String;
else if (key.Type == "EXPAND_SZ")
kind = RegistryValueKind.ExpandString;
else if (key.Type == "REG_BINARY")
kind = RegistryValueKind.Binary;
else if (key.Type == "REG_DWORD")
kind = RegistryValueKind.DWord;
else if (key.Type == "REG_MULTI_SZ")
kind = RegistryValueKind.MultiString;
else if (key.Type == "REG_QWORD")
kind = RegistryValueKind.QWord;
Registry.SetValue(key.ParentKey, key.Entry, key.Value, kind);
}
obj.RegValues.ForEach(k => k.Value.ForEach(k2 => ImportKey(k2.Value)));
}
}
private static void ImportKey(RegValueObject key)
{
var kind = RegistryValueKind.Unknown;
if (key.Type == "REG_NONE")
kind = RegistryValueKind.None;
else if (key.Type == "REG_SZ")
kind = RegistryValueKind.String;
else if (key.Type == "EXPAND_SZ")
kind = RegistryValueKind.ExpandString;
else if (key.Type == "REG_BINARY")
kind = RegistryValueKind.Binary;
else if (key.Type == "REG_DWORD")
kind = RegistryValueKind.DWord;
else if (key.Type == "REG_MULTI_SZ")
kind = RegistryValueKind.MultiString;
else if (key.Type == "REG_QWORD")
kind = RegistryValueKind.QWord;
Registry.SetValue(key.ParentKey, key.Entry, key.Value, kind);
}
}