From 21c5fcb28d3369b422f1471fc83e7de4e186c392 Mon Sep 17 00:00:00 2001 From: David Hall Date: Sun, 27 Jan 2019 17:41:34 -0500 Subject: [PATCH] Added ToRegString methods for Guids --- Windows.Shell/RegistryExtensions.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Windows.Shell/RegistryExtensions.cs b/Windows.Shell/RegistryExtensions.cs index f9dfa05b..137ddbe8 100644 --- a/Windows.Shell/RegistryExtensions.cs +++ b/Windows.Shell/RegistryExtensions.cs @@ -44,5 +44,9 @@ namespace Vanara.Windows.Shell } public static bool HasValue(this RegistryKey key, string name) => !Equals(key.GetValue(name, improbableValue), improbableValue); + + public static string ToRegString(this Guid guid) => guid.ToString("B").ToUpperInvariant(); + + public static string ToRegString(this Guid? guid) => guid.HasValue ? guid.Value.ToRegString() : null; } } \ No newline at end of file