diff --git a/Directory.Build.props b/Directory.Build.props index 2d1293c..16b4589 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -19,7 +19,7 @@ all - 3.6.128 + 3.6.132 diff --git a/sample/SampleApplication/SampleApplication.csproj b/sample/SampleApplication/SampleApplication.csproj index 17deeae..bc11be9 100644 --- a/sample/SampleApplication/SampleApplication.csproj +++ b/sample/SampleApplication/SampleApplication.csproj @@ -17,7 +17,6 @@ - diff --git a/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows.csproj b/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows.csproj index 6172a16..26e87a7 100644 --- a/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows.csproj +++ b/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows.csproj @@ -20,11 +20,10 @@ + - - - + diff --git a/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/src/SteamRegistry.cs b/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/src/SteamRegistry.cs index 2759fd3..522ab99 100644 --- a/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/src/SteamRegistry.cs +++ b/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/src/SteamRegistry.cs @@ -3,7 +3,6 @@ using System.IO.Abstractions; using System.Linq; using AnakinRaW.CommonUtilities.Registry; -using AnakinRaW.CommonUtilities.Registry.Windows; using Microsoft.Extensions.DependencyInjection; #if NET using System.Diagnostics.CodeAnalysis; @@ -98,10 +97,10 @@ public ISet? InstalledApps public SteamRegistry(IServiceProvider serviceProvider) { - _registryKey = new WindowsRegistry() + _registryKey = serviceProvider.GetRequiredService() .OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default) .CreateSubKey("Software\\Valve\\Steam"); - _fileSystem = serviceProvider.GetService() ?? new FileSystem(); + _fileSystem = serviceProvider.GetRequiredService(); } diff --git a/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/test/PetroGlyph.Games.EawFoc.Clients.Steam.Windows.Test.csproj b/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/test/PetroGlyph.Games.EawFoc.Clients.Steam.Windows.Test.csproj index 97e7783..77eba87 100644 --- a/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/test/PetroGlyph.Games.EawFoc.Clients.Steam.Windows.Test.csproj +++ b/src/PetroGlyph.Games.EawFoc.Clients.Steam.Windows/test/PetroGlyph.Games.EawFoc.Clients.Steam.Windows.Test.csproj @@ -15,7 +15,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/PetroGlyph.Games.EawFoc.Clients.Steam/test/PetroGlyph.Games.EawFoc.Clients.Steam.Test.csproj b/src/PetroGlyph.Games.EawFoc.Clients.Steam/test/PetroGlyph.Games.EawFoc.Clients.Steam.Test.csproj index 44c8d9c..3ff855d 100644 --- a/src/PetroGlyph.Games.EawFoc.Clients.Steam/test/PetroGlyph.Games.EawFoc.Clients.Steam.Test.csproj +++ b/src/PetroGlyph.Games.EawFoc.Clients.Steam/test/PetroGlyph.Games.EawFoc.Clients.Steam.Test.csproj @@ -16,7 +16,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/PetroGlyph.Games.EawFoc.Clients/test/PetroGlyph.Games.EawFoc.Clients.Test.csproj b/src/PetroGlyph.Games.EawFoc.Clients/test/PetroGlyph.Games.EawFoc.Clients.Test.csproj index d902765..264d05f 100644 --- a/src/PetroGlyph.Games.EawFoc.Clients/test/PetroGlyph.Games.EawFoc.Clients.Test.csproj +++ b/src/PetroGlyph.Games.EawFoc.Clients/test/PetroGlyph.Games.EawFoc.Clients.Test.csproj @@ -16,7 +16,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/PetroGlyph.Games.EawFoc/src/IWindowsRegistry.cs b/src/PetroGlyph.Games.EawFoc/src/IWindowsRegistry.cs deleted file mode 100644 index ab155b6..0000000 --- a/src/PetroGlyph.Games.EawFoc/src/IWindowsRegistry.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; -using Microsoft.Win32; - -namespace PetroGlyph.Games.EawFoc; - -/// -/// High-Level abstraction layer for the Windows Registry. -/// Each method is scoped to a the instance's . -/// This service supports read and write operations. -/// -public interface IWindowsRegistry : IDisposable -{ - /// - /// The root key of this instance. - /// All methods use this key as a base and subpath are built based on this key. - /// It also holds the registry view (32bit/64bit). - /// - RegistryKey RootKey { get; } - - /// - /// Tries to get a value from a registry key. - /// - /// The requested type of the key's value. - /// The name of the key. - /// The sub path of the key. - /// The returned value or if no value could be found. - /// - bool GetValueOrDefault(string name, string subPath, out T? result, T? defaultValue); - - /// - /// Tries to get a value from a registry key. - /// - /// The requested type of the key's value. - /// The name of the key. - /// The returned value or if no value could be found. - /// if a value was found; otherwise. - /// if a value was found; otherwise. - bool GetValueOrDefault(string name, out T? result, T? defaultValue); - - /// - /// Checks whether a given path exists in the registry. - /// - /// The requested path. - /// if a path exists; otherwise. - bool HasPath(string path); - - /// - /// Checks whether a given key exists in the registry. - /// - /// The requested key. - /// if a key exists; otherwise. - bool HasValue(string name); - - /// - /// Gets the value of a given key. - /// - /// The requested type of the key's value. - /// The name of the key. - /// The sub path of the key. - /// The returned value or default value if no value could be found. - /// if a value was found; otherwise. - bool GetValue(string name, string subPath, out T? value); - - /// - /// Gets the value of a given key. - /// - /// The requested type of the key's value. - /// The name of the key. - /// The returned value or default value if no value could be found. - /// if a value was found; otherwise. - bool GetValue(string name, out T? value); - - /// - /// Gets the of a given path. - /// - /// The sub-path. - /// Set to if write access is required. Default is . - /// The registry key or if the operation failed. - RegistryKey? GetKey(string subPath, bool writable = false); - - /// - /// Tries to get a value from a registry key. If the key did not exist, a key with a given default value gets created. - /// - /// The requested type of the key's value. - /// The name of the key. - /// The default value which shall be set - /// Gets set to if was set; otherwise. - /// The actual or default value of the key. - T? GetValueOrSetDefault(string name, T? defaultValue, out bool defaultValueUsed); - - /// - /// Tries to get a value from a registry key. If the key did not exist, a key with a given default value gets created. - /// - /// The requested type of the key's value. - /// The name of the key. - /// The sub-path. - /// The default value which shall be set. - /// Gets set to if was set; otherwise. - /// The actual or default value of the key. - /// If the requested registry key could not be found. - T? GetValueOrSetDefault(string name, string subPath, T? defaultValue, out bool defaultValueUsed); - - /// - /// Tries to write a value from a registry key. - /// - /// The name of the key. - /// The value which shall be set. - /// if a value was set successfully; otherwise. - bool WriteValue(string name, object value); - - /// - /// Tries to write a value from a registry key. - /// - /// The name of the key. - /// The sub-path. - /// The value which shall be set. - /// if a value was set successfully; otherwise. - bool WriteValue(string name, string subPath, object value); - - /// - /// Tries to delete a value from a registry key. - /// - /// The name of the key. - /// if a value was deleted successfully; otherwise. - bool DeleteValue(string name); - - /// - /// Tries to delete a value from a registry key. - /// - /// The name of the key. - /// The sub-path. - /// if a value was deleted successfully; otherwise. - bool DeleteValue(string name, string subPath); - - /// - /// Retrieves an array of strings that contains all the subkey names or if the operation failed. - /// - /// The sub-path. - /// An array of strings that contains the names of the subkeys for the given . - string[]? GetSubKeyNames(string subPath); -} \ No newline at end of file diff --git a/src/PetroGlyph.Games.EawFoc/src/PetroGlyph.Games.EawFoc.csproj b/src/PetroGlyph.Games.EawFoc/src/PetroGlyph.Games.EawFoc.csproj index adaf35a..7a2770b 100644 --- a/src/PetroGlyph.Games.EawFoc/src/PetroGlyph.Games.EawFoc.csproj +++ b/src/PetroGlyph.Games.EawFoc/src/PetroGlyph.Games.EawFoc.csproj @@ -26,9 +26,8 @@ - - + diff --git a/src/PetroGlyph.Games.EawFoc/test/PetroGlyph.Games.EawFoc.Test.csproj b/src/PetroGlyph.Games.EawFoc/test/PetroGlyph.Games.EawFoc.Test.csproj index 7a172a4..96013ad 100644 --- a/src/PetroGlyph.Games.EawFoc/test/PetroGlyph.Games.EawFoc.Test.csproj +++ b/src/PetroGlyph.Games.EawFoc/test/PetroGlyph.Games.EawFoc.Test.csproj @@ -18,7 +18,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive