Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IdApplicationAttributesEventArgs.cs
1using System.Collections.Generic;
2using System.Xml;
5
7{
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
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}
Helps with common XML-related tasks.
Definition: XML.cs:19
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition: XML.cs:914
Event arguments for callback methods to ID Application attributes queries.
int NrReviewers
Number of peer reviewers required to get an ID approved using peer review.
string[] RequiredProperties
Required properties in an ID application for peer-review.
bool PeerReview
If peer-review is allowed as a mechanism to approve ID applications.
IdApplicationAttributesEventArgs(IqResultEventArgs e)
Event arguments for callback methods to ID Application attributes queries.
Event arguments for responses to IQ queries.
bool Ok
If the response is an OK result response (true), or an error response (false).
XmlElement FirstElement
First child element of the Response element.