// Token: 0x060007E9 RID: 2025 RVA: 0x0001D104 File Offset: 0x0001B304
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (subTreeSession == null)
            {
                throw new ArgumentNullException("subTreeSession");
            }
            EnumerableWrapper <T> enumerableWrapper = null;

            enumerableWrapper = base.GetEnumerableWrapper <T>(enumerableWrapper, base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason));
            if (enumerableWrapper.HasElements())
            {
                return(enumerableWrapper);
            }
            if (!typeof(T).IsAssignableFrom(typeof(AccountPartition)))
            {
                return(enumerableWrapper);
            }
            if (this.fqdn != null)
            {
                ADObjectId adobjectId = ADSession.GetDomainNamingContextForLocalForest();
                adobjectId = adobjectId.GetChildId("System").GetChildId(this.fqdn.ToString());
                ADPagedReader <T> collection = session.FindPaged <T>(rootId, QueryScope.SubTree, new ComparisonFilter(ComparisonOperator.Equal, AccountPartitionSchema.TrustedDomainLink, adobjectId.DistinguishedName), null, 0, null);
                enumerableWrapper = base.GetEnumerableWrapper <T>(enumerableWrapper, collection);
                if (enumerableWrapper.HasElements())
                {
                    return(enumerableWrapper);
                }
                Guid g;
                Guid.TryParse(this.fqdn, out g);
                if (TopologyProvider.LocalForestFqdn.Equals(this.fqdn.ToString(), StringComparison.OrdinalIgnoreCase) || ADObjectId.ResourcePartitionGuid.Equals(g))
                {
                    collection        = session.FindPaged <T>(rootId, QueryScope.SubTree, new ComparisonFilter(ComparisonOperator.Equal, AccountPartitionSchema.IsLocalForest, true), null, 0, null);
                    enumerableWrapper = base.GetEnumerableWrapper <T>(enumerableWrapper, collection);
                }
                if (enumerableWrapper.HasElements())
                {
                    return(enumerableWrapper);
                }
                PartitionId partitionId;
                if (ADAccountPartitionLocator.IsSingleForestTopology(out partitionId) && this.fqdn.ToString().Equals(partitionId.ForestFQDN, StringComparison.OrdinalIgnoreCase) && partitionId.PartitionObjectId != null)
                {
                    base.UpdateInternalADObjectId(new ADObjectId(partitionId.PartitionObjectId.Value));
                    enumerableWrapper = base.GetEnumerableWrapper <T>(enumerableWrapper, base.GetExactMatchObjects <T>(rootId, session, optionalData));
                }
            }
            return(enumerableWrapper);
        }
        private static IEnumerable <T> FindPagedAllMatchingObjects <T>(QueryFilter filter, bool includeAccountForestRootOrg, bool includeResourceForest, bool useGC, ConsistencyMode consistencyMode, bool useRecipientSession, bool includeSoftDeletedObject, bool includeSecondaryPartitions) where T : ADObject, new()
        {
            IEnumerable <ADSessionSettings> sessionSettingsCollection = PartitionDataAggregator.CreateSessionSettingsCollection(includeAccountForestRootOrg, includeResourceForest, includeSecondaryPartitions);

            foreach (ADSessionSettings sessionSettings in sessionSettingsCollection)
            {
                if (includeSoftDeletedObject)
                {
                    sessionSettings.IncludeSoftDeletedObjects = true;
                }
                IDirectorySession session = PartitionDataAggregator.GetDirectorySession(consistencyMode, useRecipientSession, sessionSettings);
                session.UseGlobalCatalog = useGC;
                ADPagedReader <T> reader = session.FindPaged <T>(null, QueryScope.SubTree, filter, null, 0, null);
                foreach (T result in reader)
                {
                    yield return(result);
                }
            }
            yield break;
        }