From dca78b13411db96366dddfa0d68bb6d36d28ad14 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 29 Oct 2016 18:22:20 -0400 Subject: rework dlna project --- RSSDP/SsdpEmbeddedDevice.cs | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 RSSDP/SsdpEmbeddedDevice.cs (limited to 'RSSDP/SsdpEmbeddedDevice.cs') diff --git a/RSSDP/SsdpEmbeddedDevice.cs b/RSSDP/SsdpEmbeddedDevice.cs new file mode 100644 index 0000000000..c03106b2dd --- /dev/null +++ b/RSSDP/SsdpEmbeddedDevice.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Rssdp +{ + /// + /// Represents a device that is a descendant of a instance. + /// + public class SsdpEmbeddedDevice : SsdpDevice + { + + #region Fields + + private SsdpRootDevice _RootDevice; + + #endregion + + #region Constructors + + /// + /// Default constructor. + /// + public SsdpEmbeddedDevice() + { + } + + /// + /// Deserialisation constructor. + /// + /// A UPnP device description XML document. + /// Thrown if the argument is null. + /// Thrown if the argument is empty. + public SsdpEmbeddedDevice(string deviceDescriptionXml) + : base(deviceDescriptionXml) + { + } + + #endregion + + #region Public Properties + + /// + /// Returns the that is this device's first ancestor. If this device is itself an , then returns a reference to itself. + /// + 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 -- cgit v1.2.3