From 3b087ba9225e30d8f31683f6cdc068a5abbbcb54 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Sat, 6 Dec 2014 22:08:51 -0800 Subject: [PATCH] minor cleanup --- src/NzbDrone.Common/Processes/ProcessOutput.cs | 4 ++-- src/NzbDrone.Host/AccessControl/FirewallAdapter.cs | 11 ++++------- src/NzbDrone.Host/Owin/OwinTraceOutputFactory.cs | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/NzbDrone.Common/Processes/ProcessOutput.cs b/src/NzbDrone.Common/Processes/ProcessOutput.cs index 231b6097e..e1b3cea27 100644 --- a/src/NzbDrone.Common/Processes/ProcessOutput.cs +++ b/src/NzbDrone.Common/Processes/ProcessOutput.cs @@ -5,8 +5,8 @@ namespace NzbDrone.Common.Processes { public class ProcessOutput { - public List Standard { get; set; } - public List Error { get; set; } + public List Standard { get; private set; } + public List Error { get; private set; } public ProcessOutput() { diff --git a/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs b/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs index 67aa04edd..70d9f98dc 100644 --- a/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs +++ b/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using NetFwTypeLib; using NLog; using NzbDrone.Common.EnvironmentInfo; @@ -14,10 +15,10 @@ public interface IFirewallAdapter public class FirewallAdapter : IFirewallAdapter { private const NET_FW_PROFILE_TYPE_ FIREWALL_PROFILE = NET_FW_PROFILE_TYPE_.NET_FW_PROFILE_STANDARD; - + private readonly IConfigFileProvider _configFileProvider; private readonly Logger _logger; - + public FirewallAdapter(IConfigFileProvider configFileProvider, Logger logger) { _configFileProvider = configFileProvider; @@ -51,11 +52,7 @@ private bool IsNzbDronePortOpen(int port) var mgr = (INetFwMgr)Activator.CreateInstance(netFwMgrType); var ports = mgr.LocalPolicy.GetProfileByType(FIREWALL_PROFILE).GloballyOpenPorts; - foreach (INetFwOpenPort p in ports) - { - if (p.Port == port) - return true; - } + return ports.Cast().Any(p => p.Port == port); } catch (Exception ex) { diff --git a/src/NzbDrone.Host/Owin/OwinTraceOutputFactory.cs b/src/NzbDrone.Host/Owin/OwinTraceOutputFactory.cs index 058771fd1..6dc0e57ee 100644 --- a/src/NzbDrone.Host/Owin/OwinTraceOutputFactory.cs +++ b/src/NzbDrone.Host/Owin/OwinTraceOutputFactory.cs @@ -6,11 +6,11 @@ namespace NzbDrone.Host.Owin { public class OwinTraceOutputFactory : ITraceOutputFactory { - private readonly Logger logger = LogManager.GetLogger("Owin"); + private readonly Logger _logger = LogManager.GetLogger("Owin"); public TextWriter Create(string outputFile) { - return new NlogTextWriter(logger); + return new NlogTextWriter(_logger); } } } \ No newline at end of file