DeviceEventArgs.cs 1.2 KB

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