forked from PeterWaher/IoTGateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAvailableEventArgs.cs
More file actions
50 lines (44 loc) · 1.44 KB
/
AvailableEventArgs.cs
File metadata and controls
50 lines (44 loc) · 1.44 KB
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
49
50
using System;
using System.Threading.Tasks;
namespace Waher.Networking.XMPP.P2P
{
/// <summary>
/// Delegate for availability events.
/// </summary>
/// <param name="Sender">Sender of event.</param>
/// <param name="e">Event arguments.</param>
public delegate Task AvailableEventHandler(object Sender, AvailableEventArgs e);
/// <summary>
/// Event arguments for Availability events.
/// </summary>
public class AvailableEventArgs : EventArgs
{
private readonly PresenceEventArgs presence;
private readonly bool hasE2E;
private readonly bool hasP2P;
/// <summary>
/// Event arguments for Availability events.
/// </summary>
/// <param name="e">Presence event arguments.</param>
/// <param name="HasE2E">If End-to-End encryption information was found in presence stanza.</param>
/// <param name="HasP2P">If Peer-to-peer address information was found in presence stanza.</param>
public AvailableEventArgs(PresenceEventArgs e, bool HasE2E, bool HasP2P)
{
this.presence = e;
this.hasE2E = HasE2E;
this.hasP2P = HasP2P;
}
/// <summary>
/// Presence event arguments.
/// </summary>
public PresenceEventArgs Presence => this.presence;
/// <summary>
/// If End-to-End encryption information was found in presence stanza.
/// </summary>
public bool HasE2E => this.hasE2E;
/// <summary>
/// If Peer-to-peer address information was found in presence stanza.
/// </summary>
public bool HasP2P => this.hasP2P;
}
}