public ExchangeTenantRecord(OrganizationIdParameter identity, SyncedPerimeterConfig config, IEnumerable <SyncedAcceptedDomain> acceptedDomains) { this.organization = identity; this.perimeterConfig = config; this.acceptedDomains = new Dictionary <string, SyncedAcceptedDomain>(); this.domains = new List <DomainSyncRecord>(); foreach (SyncedAcceptedDomain syncedAcceptedDomain in acceptedDomains) { DomainSyncRecord domainSyncRecord = new DomainSyncRecord(syncedAcceptedDomain); this.domains.Add(domainSyncRecord); this.acceptedDomains.Add(domainSyncRecord.Name, syncedAcceptedDomain); } }
private static IList <object> CompareDomain(ExchangeTenantRecord exchangeTenantRecord, EhfCompanyRecord ehfCompanyRecord) { List <object> list = new List <object>(); if (ehfCompanyRecord != null) { IList <DomainSyncRecord> list2 = ehfCompanyRecord.Domains.Intersect(exchangeTenantRecord.Domains).ToList <DomainSyncRecord>(); if (list2.Count != ehfCompanyRecord.Domains.Count || ehfCompanyRecord.Domains.Count != exchangeTenantRecord.Domains.Count) { IList <DomainSyncRecord> list3 = exchangeTenantRecord.Domains.Except(ehfCompanyRecord.Domains).ToList <DomainSyncRecord>(); IList <DomainSyncRecord> list4 = ehfCompanyRecord.Domains.Except(exchangeTenantRecord.Domains).ToList <DomainSyncRecord>(); foreach (DomainSyncRecord domainSyncRecord in list3) { list.Add(new EhfSyncDiffRecord <DomainSyncRecord>(exchangeTenantRecord.Organization.RawIdentity, exchangeTenantRecord.AcceptedDomains[domainSyncRecord.Name].Identity, EhfSyncObjectType.AcceptedDomain, string.Empty, domainSyncRecord, null, null, exchangeTenantRecord.AcceptedDomains[domainSyncRecord.Name].SyncErrors)); } if (list4.Count > 0) { foreach (DomainSyncRecord actualObject in list4) { list.Add(new EhfSyncDiffRecord <DomainSyncRecord>(exchangeTenantRecord.Organization.RawIdentity, null, EhfSyncObjectType.AcceptedDomain, string.Empty, null, actualObject)); } } } using (IEnumerator <DomainSyncRecord> enumerator3 = list2.GetEnumerator()) { while (enumerator3.MoveNext()) { DomainSyncRecord domainSyncRecord2 = enumerator3.Current; SyncedAcceptedDomain syncedAcceptedDomain = exchangeTenantRecord.AcceptedDomains[domainSyncRecord2.Name]; if (!domainSyncRecord2.Enabled) { list.Add(new EhfSyncDiffRecord <string>(exchangeTenantRecord.Organization.RawIdentity, syncedAcceptedDomain.Identity, EhfSyncObjectType.AcceptedDomain, "ENABLED", bool.TrueString, domainSyncRecord2.Enabled.ToString(), string.Empty, syncedAcceptedDomain.SyncErrors)); } if (!domainSyncRecord2.Guid.Equals(syncedAcceptedDomain.Guid)) { list.Add(new EhfSyncDiffRecord <string>(exchangeTenantRecord.Organization.RawIdentity, syncedAcceptedDomain.Identity, EhfSyncObjectType.AcceptedDomain, "GUID", syncedAcceptedDomain.Guid.ToString(), domainSyncRecord2.Guid.ToString(), string.Empty, syncedAcceptedDomain.SyncErrors)); } } return(list); } } foreach (string text in exchangeTenantRecord.AcceptedDomains.Keys) { SyncedAcceptedDomain syncedAcceptedDomain2 = exchangeTenantRecord.AcceptedDomains[text]; list.Add(new EhfSyncDiffRecord <string>(exchangeTenantRecord.Organization.RawIdentity, syncedAcceptedDomain2.Identity, EhfSyncObjectType.AcceptedDomain, string.Empty, text, string.Empty, string.Empty, syncedAcceptedDomain2.SyncErrors)); } return(list); }
internal EhfCompanyRecord(Company company, IEnumerable <Domain> domains) { this.company = company; this.domains = new List <DomainSyncRecord>(DomainSyncRecord.CreateDomainSyncRecordList(domains)); }
public bool Equals(DomainSyncRecord record) { return(record != null && (object.ReferenceEquals(this, record) || this.name.Equals(record.Name, StringComparison.OrdinalIgnoreCase))); }