feat: Initial commit of RegistryExtensions

This commit is contained in:
Chris Cameron
2021-03-03 16:45:19 -05:00
parent c41e61391e
commit d1f8096933
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#if !SIMPLSHARP
using System.Collections.Generic;
using System.Linq;
using ICD.Common.Properties;
using Microsoft.Win32;
namespace ICD.Common.Utils.Extensions
{
public static class RegistryExtensions
{
/// <summary>
/// Opens subkeys for the given registry key.
/// </summary>
/// <param name="extends"></param>
/// <returns></returns>
public static IEnumerable<RegistryKey> OpenSubKeys([NotNull] this RegistryKey extends)
{
return extends.GetSubKeyNames()
.Select(extends.OpenSubKey)
.Where(k => k != null);
}
}
}
#endif

View File

@@ -115,6 +115,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Compile Include="Extensions\CollectionExtensions.cs" />
<Compile Include="Extensions\RegistryExtensions.cs" />
<Compile Include="Extensions\VersionExtensions.cs" />
<Compile Include="ThreadedWorkerQueue.cs" />
<Compile Include="TimeZoneInfo\IcdTimeZoneInfo.cs" />