2
0

DeviceEventArgs.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Rssdp
  5. {
  6. /// <summary>
  7. /// Event arguments for the <see cref="SsdpDevice.DeviceAdded"/> and <see cref="SsdpDevice.DeviceRemoved"/> events.
  8. /// </summary>
  9. public sealed class DeviceEventArgs : EventArgs
  10. {
  11. #region Fields
  12. private readonly SsdpDevice _Device;
  13. #endregion
  14. #region Constructors
  15. /// <summary>
  16. /// Constructs a new instance for the specified <see cref="SsdpDevice"/>.
  17. /// </summary>
  18. /// <param name="device">The <see cref="SsdpDevice"/> associated with the event this argument class is being used for.</param>
  19. /// <exception cref="ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>
  20. public DeviceEventArgs(SsdpDevice device)
  21. {
  22. if (device == null) throw new ArgumentNullException(nameof(device));
  23. _Device = device;
  24. }
  25. #endregion
  26. #region Public Properties
  27. /// <summary>
  28. /// Returns the <see cref="SsdpDevice"/> instance the event being raised for.
  29. /// </summary>
  30. public SsdpDevice Device
  31. {
  32. get { return _Device; }
  33. }
  34. #endregion
  35. }
  36. }