mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
feat: Initial commit of RegistryExtensions
This commit is contained in:
25
ICD.Common.Utils/Extensions/RegistryExtensions.cs
Normal file
25
ICD.Common.Utils/Extensions/RegistryExtensions.cs
Normal 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
|
||||||
@@ -115,6 +115,7 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<Compile Include="Extensions\CollectionExtensions.cs" />
|
<Compile Include="Extensions\CollectionExtensions.cs" />
|
||||||
|
<Compile Include="Extensions\RegistryExtensions.cs" />
|
||||||
<Compile Include="Extensions\VersionExtensions.cs" />
|
<Compile Include="Extensions\VersionExtensions.cs" />
|
||||||
<Compile Include="ThreadedWorkerQueue.cs" />
|
<Compile Include="ThreadedWorkerQueue.cs" />
|
||||||
<Compile Include="TimeZoneInfo\IcdTimeZoneInfo.cs" />
|
<Compile Include="TimeZoneInfo\IcdTimeZoneInfo.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user