SsdpEmbeddedDevice.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #region Fields
  9. private SsdpRootDevice _RootDevice;
  10. #endregion
  11. #region Constructors
  12. /// <summary>
  13. /// Default constructor.
  14. /// </summary>
  15. public SsdpEmbeddedDevice()
  16. {
  17. }
  18. #endregion
  19. #region Public Properties
  20. /// <summary>
  21. /// 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.
  22. /// </summary>
  23. public SsdpRootDevice RootDevice
  24. {
  25. get
  26. {
  27. return _RootDevice;
  28. }
  29. internal set
  30. {
  31. _RootDevice = value;
  32. lock (this.Devices)
  33. {
  34. foreach (var embeddedDevice in this.Devices)
  35. {
  36. ((SsdpEmbeddedDevice)embeddedDevice).RootDevice = _RootDevice;
  37. }
  38. }
  39. }
  40. }
  41. #endregion
  42. }
  43. }