2
0

DeviceEventArgs.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. private readonly SsdpDevice _Device;
  10. /// <summary>
  11. /// Constructs a new instance for the specified <see cref="SsdpDevice"/>.
  12. /// </summary>
  13. /// <param name="device">The <see cref="SsdpDevice"/> associated with the event this argument class is being used for.</param>
  14. /// <exception cref="ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>
  15. public DeviceEventArgs(SsdpDevice device)
  16. {
  17. if (device == null)
  18. {
  19. throw new ArgumentNullException(nameof(device));
  20. }
  21. _Device = device;
  22. }
  23. /// <summary>
  24. /// Returns the <see cref="SsdpDevice"/> instance the event being raised for.
  25. /// </summary>
  26. public SsdpDevice Device
  27. {
  28. get { return _Device; }
  29. }
  30. }
  31. }