jellyfin/RSSDP/DeviceEventArgs.cs

49 lines
1.3 KiB
C#
Raw Normal View History

2016-10-29 22:22:20 +00:00
using System;
using System.Collections.Generic;
using System.Text;
namespace Rssdp
{
2019-01-07 23:24:34 +00:00
/// <summary>
/// Event arguments for the <see cref="SsdpDevice.DeviceAdded"/> and <see cref="SsdpDevice.DeviceRemoved"/> events.
/// </summary>
public sealed class DeviceEventArgs : EventArgs
{
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
#region Fields
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
private readonly SsdpDevice _Device;
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
#endregion
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
#region Constructors
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00: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>
/// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>
public DeviceEventArgs(SsdpDevice device)
{
if (device == null) throw new ArgumentNullException("device");
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
_Device = device;
}
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
#endregion
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
#region Public Properties
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
/// <summary>
/// Returns the <see cref="SsdpDevice"/> instance the event being raised for.
/// </summary>
public SsdpDevice Device
{
get { return _Device; }
}
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
#endregion
2016-10-29 22:22:20 +00:00
2019-01-07 23:24:34 +00:00
}
}