From 72414d21101bacf6b6e479311fcbceda846fbc5d Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sat, 7 Apr 2018 10:41:58 +0200 Subject: [PATCH] Added method to load devices from the deviceprovider-loader --- RGB.NET.Core/RGBSurfaceDeviceLoader.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/RGB.NET.Core/RGBSurfaceDeviceLoader.cs b/RGB.NET.Core/RGBSurfaceDeviceLoader.cs index ef442e2..6633828 100644 --- a/RGB.NET.Core/RGBSurfaceDeviceLoader.cs +++ b/RGB.NET.Core/RGBSurfaceDeviceLoader.cs @@ -8,7 +8,19 @@ namespace RGB.NET.Core { #region Methods - // ReSharper disable once UnusedMember.Global + // ReSharper disable UnusedMember.Global + /// + /// Loads all devices the given by the provided by the give . + /// + /// The which provides the to load the devices from. + /// Specifies which types of devices to load. + /// Specifies whether the application should request exclusive access of possible or not. + /// Specifies whether exception during the initialization sequence should be thrown or not. + public void LoadDevices(IRGBDeviceProviderLoader deviceProviderLoader, RGBDeviceType loadFilter = RGBDeviceType.All, + bool exclusiveAccessIfPossible = false, bool throwExceptions = false) + where T : class, IRGBDeviceProviderLoader, new() + => LoadDevices(deviceProviderLoader.GetDeviceProvider(), loadFilter, exclusiveAccessIfPossible, throwExceptions); + /// /// Loads all devices the given is able to provide. /// @@ -56,6 +68,8 @@ namespace RGB.NET.Core } } + // ReSharper restore UnusedMember.Global + private void DeviceOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) { UpdateSurfaceRectangle();