18 return Identity is
null ||
19 Identity.State == IdentityState.Compromised ||
20 Identity.State == IdentityState.Obsoleted ||
31 return Identity is not
null && Identity.State ==
IdentityState.Approved;
44 if (Identity?.Attachments is
null)
47 if (!Identity.IsApproved())
50 bool HasFullName =
false;
51 bool HasFirstName =
false;
52 bool HasLastName =
false;
53 bool HasPersonalNumber =
false;
55 foreach (
Property P
in Identity.Properties)
68 HasPersonalNumber =
true;
77 if (!(((HasFirstName && HasLastName) || HasFullName) && HasPersonalNumber))
80 Attachment? Photo = Identity.Attachments.GetFirstImageAttachment();
97 if (legalIdentity is not
null && legalIdentity.
Properties?.Length > 0)
100 return !
string.IsNullOrWhiteSpace(Jid) ? Jid : defaultValueIfNotFound;
116 Result.FirstName = P.
Value;
120 Result.MiddleNames = P.
Value;
124 Result.LastNames = P.
Value;
128 Result.FullName = P.
Value;
132 Result.Address = P.
Value;
136 Result.Address2 = P.
Value;
140 Result.PostalCode = P.
Value;
144 Result.Area = P.
Value;
148 Result.City = P.
Value;
152 Result.Region = P.
Value;
156 Result.Country = P.
Value;
160 Result.Nationality = P.
Value;
164 switch (P.
Value.ToLower())
167 Result.Gender =
Gender.Male;
171 Result.Gender =
Gender.Female;
175 Result.Gender =
Gender.Other;
181 if (
int.TryParse(P.
Value, out
int i) && i >= 1 && i <= 31)
186 if (
int.TryParse(P.
Value, out i) && i >= 1 && i <= 12)
187 Result.BirthMonth = i;
191 if (
int.TryParse(P.
Value, out i) && i >= 1900 && i <= 2100)
192 Result.BirthYear = i;
196 Result.PersonalNumber = P.
Value;
200 Result.OrgName = P.
Value;
201 Result.HasOrg =
true;
205 Result.OrgDepartment = P.
Value;
206 Result.HasOrg =
true;
210 Result.OrgRole = P.
Value;
211 Result.HasOrg =
true;
215 Result.OrgAddress = P.
Value;
216 Result.HasOrg =
true;
220 Result.OrgAddress2 = P.
Value;
221 Result.HasOrg =
true;
225 Result.OrgPostalCode = P.
Value;
226 Result.HasOrg =
true;
230 Result.OrgArea = P.
Value;
231 Result.HasOrg =
true;
235 Result.OrgCity = P.
Value;
236 Result.HasOrg =
true;
240 Result.OrgRegion = P.
Value;
241 Result.HasOrg =
true;
245 Result.OrgCountry = P.
Value;
246 Result.HasOrg =
true;
250 Result.OrgNumber = P.
Value;
251 Result.HasOrg =
true;
255 Result.Phone = P.
Value;
259 Result.EMail = P.
Value;
263 Result.Jid = P.
Value;
268 Result.HasBirthDate =
269 Result.BirthDay.HasValue &&
270 Result.BirthMonth.HasValue &&
271 Result.BirthYear.HasValue &&
272 Result.BirthDay.Value <= DateTime.DaysInMonth(Result.
BirthYear.Value, Result.
BirthMonth.Value);
276 Result.BirthDay =
null;
277 Result.BirthMonth =
null;
278 Result.BirthYear =
null;
302 string? Domain =
null;
304 if (legalIdentity is not
null && legalIdentity.
Properties?.Length > 0)
307 return !
string.IsNullOrWhiteSpace(Domain) ? Domain : defaultValueIfNotFound;
317 if (Identity?.Properties is
null)
320 foreach (
Property P
in Identity.Properties)
349 return !Identity.IsOrganizational();
XMPP Protocol Properties.
const string PersonalNumber
Personal number
const string OrgAddress2
Organization Address line 2
const string OrgArea
Organization Area
const string OrgRegion
Organization Region
const string FullName
Full name
const string OrgCity
Organization City
const string OrgRole
Organization Role
const string OrgZipCode
Organization Zip Code
const string OrgCountry
Organization Country
const string OrgDepartment
Organization Department
const string Domain
Domain name.
const string Jid
Jabber ID
const string OrgAddress
Organization Address line 1
const string LastNames
Last names
const string OrgNumber
Organization number
const string FirstName
First name
const string OrgName
Organization name
A set of never changing property constants and helpful values.
Extensions for the LegalIdentity class.
static bool HasApprovedPersonalInformation(this LegalIdentity? Identity)
If the Legal Identity has an approved identity with personal information.
static bool IsPersonal(this LegalIdentity Identity)
Returns true if the legal identity does not have organizational properties.
static string GetJid(this LegalIdentity legalIdentity, string defaultValueIfNotFound="")
Returns the JID if the LegalIdentity has one, or the empty string otherwise.
static bool IsOrganizational(this LegalIdentity Identity)
Returns true if the legal identity has organizational properties.
static bool IsDiscarded(this LegalIdentity Identity)
Returns true if the legal identity is either null or is in a 'bad' state (rejected,...
static bool IsApproved(this LegalIdentity Identity)
Returns true if the legal identity has been approved.
static string GetDomain(this LegalIdentity legalIdentity, string defaultValueIfNotFound="")
Returns the domain if the LegalIdentity has one, or the empty string otherwise.
Contains a reference to an attachment assigned to a legal object.
static CaseInsensitiveString JoinNames(params CaseInsensitiveString[] Names)
Joins a sequence of names into a full name.
static void SeparateNames(CaseInsensitiveString FullName, out CaseInsensitiveString FirstName, out CaseInsensitiveString MiddleNames, out CaseInsensitiveString LastName)
Separates a full name into its first, middle and last names.
Property[] Properties
Properties detailing the legal identity.
string Name
Name of property
string Value
Property value
Represents a case-insensitive string.
static bool IsNullOrEmpty(CaseInsensitiveString value)
Indicates whether the specified string is null or an CaseInsensitiveString.Empty string.
IdentityState
Lists recognized legal identity states.
Gender
Gender classification in a legal ID.