private void CreateEhfDomainForNewCompany(ExSearchResultEntry entry, int ehfCompanyId)
        {
            EhfDomainItem ehfDomainItem = this.CreateDomainItemForNewCompany(entry, ehfCompanyId);

            if (ehfDomainItem == null)
            {
                base.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "Ignoring domain <{0}> for newly-created EHF company <{1}>", new object[]
                {
                    entry.DistinguishedName,
                    ehfCompanyId
                });
                return;
            }
            if (!EhfDomainSynchronizer.ValidateDomainName(entry, base.DiagSession))
            {
                base.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "Ignoring unsupported domain <{0}> for newly-created EHF company <{1}>", new object[]
                {
                    entry.DistinguishedName,
                    ehfCompanyId
                });
                return;
            }
            base.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "Creating domain <{0}> for newly-created EHF company <{1}>", new object[]
            {
                entry.DistinguishedName,
                ehfCompanyId
            });
            this.AddDomainToCreateBatch(ehfDomainItem);
        }
        private static bool LoadAcceptedDomain(ExSearchResultEntry entry, Connection sourceConnection, TargetConnection targetConnection, object state)
        {
            EhfConfigTargetConnection ehfConfigTargetConnection = (EhfConfigTargetConnection)targetConnection;

            if (!EhfSynchronizer.LoadFullEntry(entry, EhfDomainSynchronizer.AcceptedDomainAllAttributes, ehfConfigTargetConnection))
            {
                return(false);
            }
            if (!EhfDomainSynchronizer.ValidateDomainName(entry, ehfConfigTargetConnection.DiagSession))
            {
                return(false);
            }
            string configUnitDN = null;

            if (!EhfDomainSynchronizer.TryGetConfigUnit(entry, ehfConfigTargetConnection.DiagSession, out configUnitDN))
            {
                return(false);
            }
            EhfCompanyIdentity ehfCompanyIdentity;

            if (!ehfConfigTargetConnection.TryGetEhfCompanyIdentity(configUnitDN, "ignoring the object", out ehfCompanyIdentity))
            {
                return(false);
            }
            EhfDomainSynchronizer.AddAttributeToChangeEntry(entry, "msExchTenantPerimeterSettingsOrgID", ehfCompanyIdentity.EhfCompanyId.ToString());
            EhfDomainSynchronizer.AddAttributeToChangeEntry(entry, "msEdgeSyncEhfCompanyGuid", ehfCompanyIdentity.EhfCompanyGuid.ToString());
            return(true);
        }