diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-29 18:22:20 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-29 18:22:20 -0400 |
| commit | dca78b13411db96366dddfa0d68bb6d36d28ad14 (patch) | |
| tree | 7d41e670f1cadec0db9e1ed7115e151da891f7ea /RSSDP/SsdpEmbeddedDevice.cs | |
| parent | 597e27d1c6199a40398abb068282711a9cb9db1b (diff) | |
rework dlna project
Diffstat (limited to 'RSSDP/SsdpEmbeddedDevice.cs')
| -rw-r--r-- | RSSDP/SsdpEmbeddedDevice.cs | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/RSSDP/SsdpEmbeddedDevice.cs b/RSSDP/SsdpEmbeddedDevice.cs new file mode 100644 index 000000000..c03106b2d --- /dev/null +++ b/RSSDP/SsdpEmbeddedDevice.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Rssdp +{ + /// <summary> + /// Represents a device that is a descendant of a <see cref="SsdpRootDevice"/> instance. + /// </summary> + public class SsdpEmbeddedDevice : SsdpDevice + { + + #region Fields + + private SsdpRootDevice _RootDevice; + + #endregion + + #region Constructors + + /// <summary> + /// Default constructor. + /// </summary> + public SsdpEmbeddedDevice() + { + } + + /// <summary> + /// Deserialisation constructor. + /// </summary> + /// <param name="deviceDescriptionXml">A UPnP device description XML document.</param> + /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="deviceDescriptionXml"/> argument is null.</exception> + /// <exception cref="System.ArgumentException">Thrown if the <paramref name="deviceDescriptionXml"/> argument is empty.</exception> + public SsdpEmbeddedDevice(string deviceDescriptionXml) + : base(deviceDescriptionXml) + { + } + + #endregion + + #region Public Properties + + /// <summary> + /// Returns the <see cref="SsdpRootDevice"/> that is this device's first ancestor. If this device is itself an <see cref="SsdpRootDevice"/>, then returns a reference to itself. + /// </summary> + public SsdpRootDevice RootDevice + { + get + { + return _RootDevice; + } + internal set + { + _RootDevice = value; + lock (this.Devices) + { + foreach (var embeddedDevice in this.Devices) + { + ((SsdpEmbeddedDevice)embeddedDevice).RootDevice = _RootDevice; + } + } + } + } + + #endregion + + } +}
\ No newline at end of file |
