Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IdApplicationAttributesEventArgs.cs
1
using
System.Collections.Generic;
2
using
System.Xml;
3
using
Waher.Content.Xml
;
4
using
Waher.Networking.XMPP.Events
;
5
6
namespace
Waher.Networking.XMPP.Contracts.EventArguments
7
{
11
public
class
IdApplicationAttributesEventArgs
:
IqResultEventArgs
12
{
13
private
readonly
string
[] requiredProperties;
14
private
readonly
int
nrReviewers;
15
private
readonly
int
nrPhotos;
16
private
readonly
bool
peerReview;
17
private
readonly
bool
iso3166;
18
23
public
IdApplicationAttributesEventArgs
(
IqResultEventArgs
e)
24
: base(e)
25
{
26
if
(e.
Ok
)
27
{
28
this.peerReview =
XML
.
Attribute
(e.
FirstElement
,
"peerReview"
,
false
);
29
this.nrReviewers =
XML
.
Attribute
(e.
FirstElement
,
"nrReviewers"
, 0);
30
this.nrPhotos =
XML
.
Attribute
(e.
FirstElement
,
"nrPhotos"
, 0);
31
this.iso3166 =
XML
.
Attribute
(e.
FirstElement
,
"iso3166"
,
false
);
32
33
List<string> Required =
new
List<string>();
34
35
foreach
(XmlNode N2
in
e.
FirstElement
.ChildNodes)
36
{
37
if
(N2 is XmlElement E && E.LocalName ==
"required"
)
38
Required.Add(E.InnerText);
39
}
40
41
this.requiredProperties = Required.ToArray();
42
}
43
else
44
{
45
this.peerReview =
false
;
46
this.nrReviewers = 0;
47
this.nrPhotos = 0;
48
this.iso3166 =
false
;
49
this.requiredProperties =
null
;
50
}
51
}
52
56
public
bool
PeerReview
=> this.peerReview;
57
61
public
int
NrReviewers
=> this.nrReviewers;
62
66
public
int
NrPhotos
=> this.nrPhotos;
67
71
public
bool
Iso3166
=> this.iso3166;
72
76
public
string
[]
RequiredProperties
=> this.requiredProperties;
77
}
78
}
Waher.Content.Xml.XML
Helps with common XML-related tasks.
Definition:
XML.cs:19
Waher.Content.Xml.XML.Attribute
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition:
XML.cs:914
Waher.Networking.XMPP.Contracts.EventArguments.IdApplicationAttributesEventArgs
Event arguments for callback methods to ID Application attributes queries.
Definition:
IdApplicationAttributesEventArgs.cs:12
Waher.Networking.XMPP.Contracts.EventArguments.IdApplicationAttributesEventArgs.NrReviewers
int NrReviewers
Number of peer reviewers required to get an ID approved using peer review.
Definition:
IdApplicationAttributesEventArgs.cs:61
Waher.Networking.XMPP.Contracts.EventArguments.IdApplicationAttributesEventArgs.NrPhotos
int NrPhotos
Number of photos required in a peer-review.
Definition:
IdApplicationAttributesEventArgs.cs:66
Waher.Networking.XMPP.Contracts.EventArguments.IdApplicationAttributesEventArgs.RequiredProperties
string[] RequiredProperties
Required properties in an ID application for peer-review.
Definition:
IdApplicationAttributesEventArgs.cs:76
Waher.Networking.XMPP.Contracts.EventArguments.IdApplicationAttributesEventArgs.Iso3166
bool Iso3166
If ISO 3166 country codes are mandated in peer-review.
Definition:
IdApplicationAttributesEventArgs.cs:71
Waher.Networking.XMPP.Contracts.EventArguments.IdApplicationAttributesEventArgs.PeerReview
bool PeerReview
If peer-review is allowed as a mechanism to approve ID applications.
Definition:
IdApplicationAttributesEventArgs.cs:56
Waher.Networking.XMPP.Contracts.EventArguments.IdApplicationAttributesEventArgs.IdApplicationAttributesEventArgs
IdApplicationAttributesEventArgs(IqResultEventArgs e)
Event arguments for callback methods to ID Application attributes queries.
Definition:
IdApplicationAttributesEventArgs.cs:23
Waher.Networking.XMPP.Events.IqResultEventArgs
Event arguments for responses to IQ queries.
Definition:
IqResultEventArgs.cs:11
Waher.Networking.XMPP.Events.IqResultEventArgs.Ok
bool Ok
If the response is an OK result response (true), or an error response (false).
Definition:
IqResultEventArgs.cs:189
Waher.Networking.XMPP.Events.IqResultEventArgs.FirstElement
XmlElement FirstElement
First child element of the Response element.
Definition:
IqResultEventArgs.cs:145
Waher.Content.Xml
Definition:
XmlCodec.cs:11
Waher.Networking.XMPP.Contracts.EventArguments
Definition:
ContractPetitionEventArgs.cs:5
Waher.Networking.XMPP.Events
Definition:
CustomPresenceEventArgs.cs:5
IoTGateway
Networking
Waher.Networking.XMPP.Contracts
EventArguments
IdApplicationAttributesEventArgs.cs
Generated by
1.9.5