forked from PeterWaher/IoTGateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCanReadResponseEventArgs.cs
More file actions
57 lines (51 loc) · 1.45 KB
/
CanReadResponseEventArgs.cs
File metadata and controls
57 lines (51 loc) · 1.45 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
51
52
53
54
55
56
57
using System;
using System.Threading.Tasks;
using Waher.Things;
using Waher.Things.SensorData;
namespace Waher.Networking.XMPP.Provisioning
{
/// <summary>
/// Delegate for CanRead callback methods.
/// </summary>
/// <param name="Sender">Sender</param>
/// <param name="e">Event arguments.</param>
public delegate Task CanReadCallback(object Sender, CanReadResponseEventArgs e);
/// <summary>
/// Event arguments for CanRead callback event arguments.
/// </summary>
public class CanReadResponseEventArgs : NodesEventArgs
{
private readonly bool canRead;
private readonly FieldType fieldTypes;
private readonly string[] fieldNames;
internal CanReadResponseEventArgs(IqResultEventArgs e, object State, string JID, bool CanRead, FieldType FieldTypes,
IThingReference[] Nodes, string[] FieldNames)
: base(e, State, JID, Nodes)
{
this.canRead = CanRead;
this.fieldTypes = FieldTypes;
this.fieldNames = FieldNames;
}
/// <summary>
/// If the readout can be performed.
/// </summary>
public bool CanRead
{
get { return this.canRead; }
}
/// <summary>
/// Field types allowed to read, if <see cref="CanRead"/> is true.
/// </summary>
public FieldType FieldTypes
{
get { return this.fieldTypes; }
}
/// <summary>
/// Fields allowed to read, as long as <see cref="CanRead"/> is true. If null, no field restrictions exist.
/// </summary>
public string[] FieldsNames
{
get { return this.fieldNames; }
}
}
}