コード例 #1
0
        // Token: 0x06001A91 RID: 6801 RVA: 0x0006F524 File Offset: 0x0006D724
        private void AddCacheEntry(ProxyAddress proxyAddress, Result <TEntry> result, bool isLockRequired, bool populateCalculatedProperties)
        {
            TEntry data = result.Data;

            if (populateCalculatedProperties && data != null)
            {
                this.PopulateCalculatedProperties(data);
            }
            this.SetEntry(proxyAddress, result, isLockRequired);
            if (data == null)
            {
                return;
            }
            ProxyAddress primarySmtpAddress = ADRecipientCache <TEntry> .GetPrimarySmtpAddress(data);

            if (ADRecipientCache <TEntry> .IsSmtpAddress(proxyAddress))
            {
                ProxyAddress proxyAddress2 = ProxyAddress.Parse(ProxyAddressPrefix.LegacyDN.PrimaryPrefix, ADRecipientCache <TEntry> .GetLegacyExchangeDN(data));
                this.SetEntry(proxyAddress2, result, isLockRequired);
                if (null != primarySmtpAddress && primarySmtpAddress != proxyAddress)
                {
                    this.SetEntry(primarySmtpAddress, result, isLockRequired);
                    return;
                }
            }
            else if (primarySmtpAddress != null)
            {
                this.SetEntry(primarySmtpAddress, result, isLockRequired);
            }
        }
コード例 #2
0
        // Token: 0x06001A79 RID: 6777 RVA: 0x0006EA5C File Offset: 0x0006CC5C
        public virtual bool Remove(ProxyAddress proxyAddress)
        {
            bool result2;

            lock (this.dictionaryLock)
            {
                Result <TEntry> result;
                if (this.dictionary.TryGetValue(proxyAddress, out result))
                {
                    this.dictionary.Remove(proxyAddress);
                    if (result.Data == null)
                    {
                        result2 = true;
                    }
                    else
                    {
                        if (ADRecipientCache <TEntry> .IsExAddress(proxyAddress))
                        {
                            this.dictionary.Remove(ADRecipientCache <TEntry> .GetPrimarySmtpAddress(result.Data));
                        }
                        else if (ADRecipientCache <TEntry> .IsSmtpAddress(proxyAddress))
                        {
                            this.dictionary.Remove(ProxyAddress.Parse(ProxyAddressPrefix.LegacyDN.PrimaryPrefix, ADRecipientCache <TEntry> .GetLegacyExchangeDN(result.Data)));
                        }
                        result2 = true;
                    }
                }
                else
                {
                    result2 = false;
                }
            }
            return(result2);
        }