DeviceEventArgs.cs 1.1 KB

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