private void UpdateContacts(Slot slot, string stringValue) { if (slot.Value is UriReferent uriReferent) { switch (uriReferent.Scheme) { case "mailto": Emails.Add(uriReferent.Value); break; case "http": case "https": { if (Company == null) { Company = new CompanyReferent(); } Company.Site = stringValue; Site = stringValue; break; } } } if (slot.Value is EP.Ner.Phone.PhoneReferent phoneReferent) { Phones.Add(new PhoneReferent(phoneReferent)); } if (slot.Value is AddressReferent addressReferent) { UpdateDescription($"Адрес: {addressReferent}"); } }
private void UpdateAttributes(Slot slot) { if (!(slot.Value is PersonPropertyReferent personPropertyReferent)) { return; } UpdatePosition(personPropertyReferent); if (!(personPropertyReferent.Slots.FirstOrDefault(c => c.Value is OrganizationReferent)?.Value is OrganizationReferent organization)) { return; } if (Company == null) { Company = new CompanyReferent(); } if (organization.Higher != null) { var higher = GetHigher(organization); ((CompanyReferent)Company).Fill(higher.Kind == OrganizationKind.Department ? organization : higher); } else { ((CompanyReferent)Company).Fill(organization); } UpdateDescription(organization); }