aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/UPnP10DeviceValidator.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-08-27 13:34:55 -0400
committerGitHub <noreply@github.com>2017-08-27 13:34:55 -0400
commitf3ee129bd9e88e8768221ba176bc8356f9b240e3 (patch)
tree72dc082f77629e8d70f764d175433b40ac4c02d0 /RSSDP/UPnP10DeviceValidator.cs
parent4f8684a16b1102056bd2b527dcbd585b78dd8000 (diff)
parentfa6bec94b59cf850246c5d0757b9279d080643d7 (diff)
Merge pull request #2847 from MediaBrowser/beta
Beta
Diffstat (limited to 'RSSDP/UPnP10DeviceValidator.cs')
-rw-r--r--RSSDP/UPnP10DeviceValidator.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/RSSDP/UPnP10DeviceValidator.cs b/RSSDP/UPnP10DeviceValidator.cs
index f802b7639..2a8a9ccd2 100644
--- a/RSSDP/UPnP10DeviceValidator.cs
+++ b/RSSDP/UPnP10DeviceValidator.cs
@@ -26,11 +26,11 @@ namespace Rssdp.Infrastructure
/// <param name="device">The <see cref="SsdpRootDevice"/> to validate.</param>
/// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>
/// <returns>A non-null enumerable set of strings, empty if there are no validation errors, otherwise each string represents a discrete problem.</returns>
- public IEnumerable<string> GetValidationErrors(SsdpRootDevice device)
+ public List<string> GetValidationErrors(SsdpRootDevice device)
{
if (device == null) throw new ArgumentNullException("device");
- var retVal = GetValidationErrors((SsdpDevice)device) as IList<string>;
+ var retVal = GetValidationErrors((SsdpDevice)device);
if (device.Location == null)
retVal.Add("Location cannot be null.");
@@ -49,7 +49,7 @@ namespace Rssdp.Infrastructure
/// <param name="device">The <see cref="SsdpDevice"/> to validate.</param>
/// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>
/// <returns>A non-null enumerable set of strings, empty if there are no validation errors, otherwise each string represents a discrete problem.</returns>
- public IEnumerable<string> GetValidationErrors(SsdpDevice device)
+ public List<string> GetValidationErrors(SsdpDevice device)
{
if (device == null) throw new ArgumentNullException("device");
@@ -110,7 +110,7 @@ namespace Rssdp.Infrastructure
if (String.IsNullOrEmpty(device.ModelName))
retVal.Add("ModelName is required.");
- if (device.Icons.Any())
+ if (device.Icons.Count > 0)
ValidateIcons(device, retVal);
ValidateChildDevices(device, retVal);
@@ -127,7 +127,7 @@ namespace Rssdp.Infrastructure
public void ThrowIfDeviceInvalid(SsdpDevice device)
{
var errors = this.GetValidationErrors(device);
- if (errors != null && errors.Any()) throw new InvalidOperationException("Invalid device settings : " + String.Join(Environment.NewLine, errors));
+ if (errors != null && errors.Count > 0) throw new InvalidOperationException("Invalid device settings : " + String.Join(Environment.NewLine, errors));
}
#endregion