diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-01-16 19:10:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-16 19:10:42 +0100 |
| commit | 900dc851e6c810f9e1772a6fb901a5a7e2801baf (patch) | |
| tree | 205bac3cd6df971ee18739e59bd4da0ffe91718b /RSSDP/DiscoveredSsdpDevice.cs | |
| parent | 07a8e49c4b1e4a2dddbaa49ab6f1ff4f271fbf20 (diff) | |
| parent | 933ef438894ed233fec46badf58dd4f26492e832 (diff) | |
Merge branch 'dev' into cleanup
Diffstat (limited to 'RSSDP/DiscoveredSsdpDevice.cs')
| -rw-r--r-- | RSSDP/DiscoveredSsdpDevice.cs | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/RSSDP/DiscoveredSsdpDevice.cs b/RSSDP/DiscoveredSsdpDevice.cs index 7e70817dd..0c5701d29 100644 --- a/RSSDP/DiscoveredSsdpDevice.cs +++ b/RSSDP/DiscoveredSsdpDevice.cs @@ -7,88 +7,88 @@ using System.Net.Http.Headers; namespace Rssdp { - /// <summary> - /// Represents a discovered device, containing basic information about the device and the location of it's full device description document. Also provides convenience methods for retrieving the device description document. - /// </summary> - /// <seealso cref="SsdpDevice"/> - /// <seealso cref="Rssdp.Infrastructure.ISsdpDeviceLocator"/> - public sealed class DiscoveredSsdpDevice - { - - #region Fields - - private DateTimeOffset _AsAt; - - #endregion - - #region Public Properties - - /// <summary> - /// Sets or returns the type of notification, being either a uuid, device type, service type or upnp:rootdevice. - /// </summary> - public string NotificationType { get; set; } - - /// <summary> - /// Sets or returns the universal service name (USN) of the device. - /// </summary> - public string Usn { get; set; } - - /// <summary> - /// Sets or returns a URL pointing to the device description document for this device. - /// </summary> - public Uri DescriptionLocation { get; set; } - - /// <summary> - /// Sets or returns the length of time this information is valid for (from the <see cref="AsAt"/> time). - /// </summary> - public TimeSpan CacheLifetime { get; set; } - - /// <summary> - /// Sets or returns the date and time this information was received. - /// </summary> - public DateTimeOffset AsAt - { - get { return _AsAt; } - set - { - if (_AsAt != value) - { - _AsAt = value; - } - } - } - - /// <summary> - /// Returns the headers from the SSDP device response message - /// </summary> - public HttpHeaders ResponseHeaders { get; set; } - - #endregion - - #region Public Methods - - /// <summary> - /// Returns true if this device information has expired, based on the current date/time, and the <see cref="CacheLifetime"/> & <see cref="AsAt"/> properties. - /// </summary> - /// <returns></returns> - public bool IsExpired() - { - return this.CacheLifetime == TimeSpan.Zero || this.AsAt.Add(this.CacheLifetime) <= DateTimeOffset.Now; - } - - #endregion - - #region Overrides - - /// <summary> - /// Returns the device's <see cref="Usn"/> value. - /// </summary> - /// <returns>A string containing the device's universal service name.</returns> - public override string ToString() - { - return this.Usn; - } - - #endregion - } + /// <summary> + /// Represents a discovered device, containing basic information about the device and the location of it's full device description document. Also provides convenience methods for retrieving the device description document. + /// </summary> + /// <seealso cref="SsdpDevice"/> + /// <seealso cref="Rssdp.Infrastructure.ISsdpDeviceLocator"/> + public sealed class DiscoveredSsdpDevice + { + + #region Fields + + private DateTimeOffset _AsAt; + + #endregion + + #region Public Properties + + /// <summary> + /// Sets or returns the type of notification, being either a uuid, device type, service type or upnp:rootdevice. + /// </summary> + public string NotificationType { get; set; } + + /// <summary> + /// Sets or returns the universal service name (USN) of the device. + /// </summary> + public string Usn { get; set; } + + /// <summary> + /// Sets or returns a URL pointing to the device description document for this device. + /// </summary> + public Uri DescriptionLocation { get; set; } + + /// <summary> + /// Sets or returns the length of time this information is valid for (from the <see cref="AsAt"/> time). + /// </summary> + public TimeSpan CacheLifetime { get; set; } + + /// <summary> + /// Sets or returns the date and time this information was received. + /// </summary> + public DateTimeOffset AsAt + { + get { return _AsAt; } + set + { + if (_AsAt != value) + { + _AsAt = value; + } + } + } + + /// <summary> + /// Returns the headers from the SSDP device response message + /// </summary> + public HttpHeaders ResponseHeaders { get; set; } + + #endregion + + #region Public Methods + + /// <summary> + /// Returns true if this device information has expired, based on the current date/time, and the <see cref="CacheLifetime"/> & <see cref="AsAt"/> properties. + /// </summary> + /// <returns></returns> + public bool IsExpired() + { + return this.CacheLifetime == TimeSpan.Zero || this.AsAt.Add(this.CacheLifetime) <= DateTimeOffset.Now; + } + + #endregion + + #region Overrides + + /// <summary> + /// Returns the device's <see cref="Usn"/> value. + /// </summary> + /// <returns>A string containing the device's universal service name.</returns> + public override string ToString() + { + return this.Usn; + } + + #endregion + } } |
