SsdpEmbeddedDevice.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. namespace Rssdp
  2. {
  3. /// <summary>
  4. /// Represents a device that is a descendant of a <see cref="SsdpRootDevice"/> instance.
  5. /// </summary>
  6. public class SsdpEmbeddedDevice : SsdpDevice
  7. {
  8. private SsdpRootDevice _RootDevice;
  9. /// <summary>
  10. /// Default constructor.
  11. /// </summary>
  12. public SsdpEmbeddedDevice()
  13. {
  14. }
  15. /// <summary>
  16. /// 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.
  17. /// </summary>
  18. public SsdpRootDevice RootDevice
  19. {
  20. get
  21. {
  22. return _RootDevice;
  23. }
  24. internal set
  25. {
  26. _RootDevice = value;
  27. lock (this.Devices)
  28. {
  29. foreach (var embeddedDevice in this.Devices)
  30. {
  31. ((SsdpEmbeddedDevice)embeddedDevice).RootDevice = _RootDevice;
  32. }
  33. }
  34. }
  35. }
  36. }
  37. }