diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-07-14 08:39:15 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-07-14 08:39:15 -0500 |
| commit | 3f5ebfde9be34a80a28dc8c08efaa4c9417184dc (patch) | |
| tree | 7992fdc442a9f65daf0ca603006bb1869a2a0442 /src | |
| parent | c10a01c6d58ca71ec629d08998bea47698a1d3c2 (diff) | |
| download | slskd-3f5ebfde9be34a80a28dc8c08efaa4c9417184dc.tar.gz | |
simplify using for microsoft Options
Diffstat (limited to 'src')
6 files changed, 17 insertions, 6 deletions
diff --git a/src/slskd/Application/Management/ManagementService.cs b/src/slskd/Application/Management/ManagementService.cs index 4a385cff..7bcdc7be 100644 --- a/src/slskd/Application/Management/ManagementService.cs +++ b/src/slskd/Application/Management/ManagementService.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> +using Microsoft.Extensions.Options; + namespace slskd.Management { using System; @@ -32,7 +34,7 @@ namespace slskd.Management /// <param name="optionsMonitor">The options monitor used to derive application options.</param> /// <param name="soulseekClient">The Soulseek client.</param> public ManagementService( - Microsoft.Extensions.Options.IOptionsMonitor<Options> optionsMonitor, + IOptionsMonitor<Options> optionsMonitor, ISoulseekClient soulseekClient) { OptionsMonitor = optionsMonitor; @@ -41,7 +43,7 @@ namespace slskd.Management private ISoulseekClient Client { get; } private Options Options => OptionsMonitor.CurrentValue; - private Microsoft.Extensions.Options.IOptionsMonitor<Options> OptionsMonitor { get; } + private IOptionsMonitor<Options> OptionsMonitor { get; } /// <summary> /// Connects the Soulseek client to the server using the configured username and password. diff --git a/src/slskd/Application/Transfer/API/Controllers/TransfersController.cs b/src/slskd/Application/Transfer/API/Controllers/TransfersController.cs index 97b86689..9ed36d1b 100644 --- a/src/slskd/Application/Transfer/API/Controllers/TransfersController.cs +++ b/src/slskd/Application/Transfer/API/Controllers/TransfersController.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> +using Microsoft.Extensions.Options; + namespace slskd.Transfer.API { using System; @@ -46,7 +48,7 @@ namespace slskd.Transfer.API /// <param name="tracker"></param> /// <param name="ftpClient"></param> public TransfersController( - Microsoft.Extensions.Options.IOptionsSnapshot<Options> options, + IOptionsSnapshot<Options> options, ISoulseekClient client, ITransferTracker tracker, IFTPService ftpClient) diff --git a/src/slskd/Integrations/FTP/FTPClientFactory.cs b/src/slskd/Integrations/FTP/FTPClientFactory.cs index cc076ca1..7c55195f 100644 --- a/src/slskd/Integrations/FTP/FTPClientFactory.cs +++ b/src/slskd/Integrations/FTP/FTPClientFactory.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> +using Microsoft.Extensions.Options; + namespace slskd.Integrations.FTP { using System; @@ -30,7 +32,7 @@ namespace slskd.Integrations.FTP /// Initializes a new instance of the <see cref="FTPClientFactory"/> class. /// </summary> /// <param name="optionsMonitor">The options monitor used to derive application options.</param> - public FTPClientFactory(Microsoft.Extensions.Options.IOptionsMonitor<Options> optionsMonitor) + public FTPClientFactory(IOptionsMonitor<Options> optionsMonitor) { Options = optionsMonitor.CurrentValue; diff --git a/src/slskd/Integrations/FTP/FTPService.cs b/src/slskd/Integrations/FTP/FTPService.cs index a5fe6a8f..4b3f45ce 100644 --- a/src/slskd/Integrations/FTP/FTPService.cs +++ b/src/slskd/Integrations/FTP/FTPService.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> +using Microsoft.Extensions.Options; + namespace slskd.Integrations.FTP { using System; @@ -38,7 +40,7 @@ namespace slskd.Integrations.FTP /// <param name="log">The logger.</param> public FTPService( IFTPClientFactory ftpClientFactory, - Microsoft.Extensions.Options.IOptionsMonitor<Options> optionsMonitor, + IOptionsMonitor<Options> optionsMonitor, ILogger<FTPService> log) { Factory = ftpClientFactory; diff --git a/src/slskd/Integrations/Pushbullet/PushbulletService.cs b/src/slskd/Integrations/Pushbullet/PushbulletService.cs index cb31e6dc..04994d92 100644 --- a/src/slskd/Integrations/Pushbullet/PushbulletService.cs +++ b/src/slskd/Integrations/Pushbullet/PushbulletService.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> +using Microsoft.Extensions.Options; + namespace slskd.Integrations.Pushbullet { using System; @@ -41,7 +43,7 @@ namespace slskd.Integrations.Pushbullet /// <param name="log">The logger.</param> public PushbulletService( IHttpClientFactory httpClientFactory, - Microsoft.Extensions.Options.IOptionsMonitor<Options> optionsMonitor, + IOptionsMonitor<Options> optionsMonitor, ILogger<PushbulletService> log) { HttpClientFactory = httpClientFactory; diff --git a/src/slskd/Properties/analysis.ruleset b/src/slskd/Properties/analysis.ruleset index 09e99d9e..4e4ae5cf 100644 --- a/src/slskd/Properties/analysis.ruleset +++ b/src/slskd/Properties/analysis.ruleset @@ -45,6 +45,7 @@ <Rule Id="SA1116" Action="None" /> <Rule Id="SA1117" Action="None" /> <Rule Id="SA1124" Action="None" /> + <Rule Id="SA1200" Action="Info" /> <Rule Id="SA1300" Action="None" /> <Rule Id="SA1402" Action="None" /> <Rule Id="SA1516" Action="None" /> |
