Class Upnp10DeviceValidator
Validates a SsdpDevice object's properties meet the UPnP 1.0 specification.
Inheritance
Implements
Inherited Members
Namespace: Rssdp.Infrastructure
Assembly: cs.temp.dll.dll
Syntax
public class Upnp10DeviceValidator : IUpnpDeviceValidator
Remarks
This is a best effort validation for known rules, it doesn't guarantee 100% compatibility with the specification. Reading the specification yourself is the best way to ensure compatibility.
Methods
GetValidationErrors(SsdpDevice)
Returns an enumerable set of strings, each one being a description of an invalid property on the specified device.
Declaration
public IEnumerable<string> GetValidationErrors(SsdpDevice device)
Parameters
| Type | Name | Description |
|---|---|---|
| SsdpDevice | device | The SsdpDevice to validate. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.String> | A non-null enumerable set of strings, empty if there are no validation errors, otherwise each string represents a discrete problem. |
Remarks
If no errors are found, an empty (but non-null) enumerable is returned.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if the |
GetValidationErrors(SsdpRootDevice)
Returns an enumerable set of strings, each one being a description of an invalid property on the specified root device.
Declaration
public IEnumerable<string> GetValidationErrors(SsdpRootDevice device)
Parameters
| Type | Name | Description |
|---|---|---|
| SsdpRootDevice | device | The SsdpRootDevice to validate. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.String> | A non-null enumerable set of strings, empty if there are no validation errors, otherwise each string represents a discrete problem. |
Remarks
If no errors are found, an empty (but non-null) enumerable is returned.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if the |
ThrowIfDeviceInvalid(SsdpDevice)
Validates the specified device and throws an System.InvalidOperationException if there are any validation errors.
Declaration
public void ThrowIfDeviceInvalid(SsdpDevice device)
Parameters
| Type | Name | Description |
|---|---|---|
| SsdpDevice | device | The SsdpDevice to validate. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if the |
| System.InvalidOperationException | Thrown if the device object does not pass validation. |