aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/DeviceEventArgs.cs
blob: 3925ba2481699a25c3a744ee52f954969e0e1833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
using System.Text;

namespace Rssdp
{
    /// <summary>
    /// Event arguments for the <see cref="SsdpDevice.DeviceAdded"/> and <see cref="SsdpDevice.DeviceRemoved"/> events.
    /// </summary>
    public sealed class DeviceEventArgs : EventArgs
    {

        #region Fields

        private readonly SsdpDevice _Device;

        #endregion

        #region Constructors

        /// <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="ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>
        public DeviceEventArgs(SsdpDevice device)
        {
            if (device == null) throw new ArgumentNullException(nameof(device));

            _Device = device;
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Returns the <see cref="SsdpDevice"/> instance the event being raised for.
        /// </summary>
        public SsdpDevice Device
        {
            get { return _Device; }
        }

        #endregion

    }
}