private ADObjectId GetPolicyIdFromAD(OrganizationId key)
        {
            ExTraceGlobals.MobileDevicePolicyTracer.Information <OrganizationId>((long)this.GetHashCode(), "MobileDevicePolicyIdCacheByOrganization.GetPolicyFromAD({0})", key);
            ADSessionSettings     settings = ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(key);
            IConfigurationSession session  = this.GetConfigSession(settings);
            ADObjectId            rootId   = session.GetOrgContainerId();
            QueryFilter           filter   = new BitMaskAndFilter(MobileMailboxPolicySchema.MobileFlags, 4096UL);
            SortBy     sortBy   = new SortBy(ADObjectSchema.WhenChanged, SortOrder.Descending);
            ADObjectId policyId = null;

            try
            {
                ADNotificationAdapter.RunADOperation(delegate()
                {
                    MobileMailboxPolicy[] array = session.Find <MobileMailboxPolicy>(rootId, QueryScope.SubTree, filter, sortBy, 1);
                    if (array != null && array.Length > 0)
                    {
                        policyId = array[0].Id;
                        OrgIdADObjectWrapper key2 = new OrgIdADObjectWrapper(policyId, key);
                        if (!MobileDevicePolicyCache.Instance.Contains(key2))
                        {
                            MobileDevicePolicyData mobileDevicePolicyDataFromMobileMailboxPolicy = MobileDevicePolicyDataFactory.GetMobileDevicePolicyDataFromMobileMailboxPolicy(array[0]);
                            MobileDevicePolicyCache.Instance.TryAdd(key2, ref mobileDevicePolicyDataFromMobileMailboxPolicy);
                        }
                    }
                });
            }
            catch (LocalizedException arg)
            {
                ExTraceGlobals.MobileDevicePolicyTracer.TraceError <OrganizationId, LocalizedException>((long)this.GetHashCode(), "MobileDevicePolicyIdCacheByOrganization.GetPolicyIdFromAD({0}) threw exception: {1}", key, arg);
                throw;
            }
            ExTraceGlobals.MobileDevicePolicyTracer.Information <OrganizationId, ADObjectId>((long)this.GetHashCode(), "MobileDevicePolicyIdCacheByOrganization.GetPolicyFromAD({0}) returned: {1}", key, policyId);
            return(policyId);
        }
        // Token: 0x06000862 RID: 2146 RVA: 0x0001B958 File Offset: 0x00019B58
        public override bool Equals(object obj)
        {
            if (!(obj is OrgIdADObjectWrapper))
            {
                return(false);
            }
            OrgIdADObjectWrapper orgIdADObjectWrapper = (OrgIdADObjectWrapper)obj;

            return(this.AdObject.Equals(orgIdADObjectWrapper.AdObject) && this.OrgId.Equals(orgIdADObjectWrapper.OrgId));
        }