SsdpEmbeddedDevice.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Rssdp
  5. {
  6. /// <summary>
  7. /// Represents a device that is a descendant of a <see cref="SsdpRootDevice"/> instance.
  8. /// </summary>
  9. public class SsdpEmbeddedDevice : SsdpDevice
  10. {
  11. #region Fields
  12. private SsdpRootDevice _RootDevice;
  13. #endregion
  14. #region Constructors
  15. /// <summary>
  16. /// Default constructor.
  17. /// </summary>
  18. public SsdpEmbeddedDevice()
  19. {
  20. }
  21. #endregion
  22. #region Public Properties
  23. /// <summary>
  24. /// 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.
  25. /// </summary>
  26. public SsdpRootDevice RootDevice
  27. {
  28. get
  29. {
  30. return _RootDevice;
  31. }
  32. internal set
  33. {
  34. _RootDevice = value;
  35. lock (this.Devices)
  36. {
  37. foreach (var embeddedDevice in this.Devices)
  38. {
  39. ((SsdpEmbeddedDevice)embeddedDevice).RootDevice = _RootDevice;
  40. }
  41. }
  42. }
  43. }
  44. #endregion
  45. }
  46. }