jellyfin/RSSDP/DeviceEventArgs.cs

36 lines
1.1 KiB
C#
Raw Normal View History

2019-01-12 15:41:08 -05:00
using System;
2016-10-29 18:22:20 -04:00
namespace Rssdp
{
2019-01-07 18:24:34 -05:00
/// <summary>
/// Event arguments for the <see cref="SsdpDevice.DeviceAdded"/> and <see cref="SsdpDevice.DeviceRemoved"/> events.
/// </summary>
public sealed class DeviceEventArgs : EventArgs
{
private readonly SsdpDevice _Device;
2016-10-29 18:22:20 -04:00
2019-01-12 15:41:08 -05:00
/// <summary>
/// Constructs a new instance for the specified <see cref="SsdpDevice"/>.
/// </summary>
/// <param name="device">The <see cref="SsdpDevice"/> associated with the event this argument class is being used for.</param>
2019-01-13 15:37:13 -05:00
/// <exception cref="ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>
2019-01-12 15:41:08 -05:00
public DeviceEventArgs(SsdpDevice device)
{
2020-06-20 04:35:29 -04:00
if (device == null)
{
throw new ArgumentNullException(nameof(device));
}
2016-10-29 18:22:20 -04:00
2019-01-07 18:24:34 -05:00
_Device = device;
}
2016-10-29 18:22:20 -04:00
2019-01-07 18:24:34 -05:00
/// <summary>
/// Returns the <see cref="SsdpDevice"/> instance the event being raised for.
/// </summary>
public SsdpDevice Device
{
get { return _Device; }
}
}
}