// Token: 0x06000FCE RID: 4046 RVA: 0x000409D0 File Offset: 0x0003EBD0
        private static List <RecipientInfoCacheEntry> Deserialize(Stream stream, string parentNodeName, out int backendCacheVersion)
        {
            backendCacheVersion = 0;
            List <RecipientInfoCacheEntry> result;

            using (XmlReader xmlReader = XmlReader.Create(stream, new XmlReaderSettings
            {
                CloseInput = false,
                CheckCharacters = false,
                IgnoreWhitespace = false
            }))
            {
                List <RecipientInfoCacheEntry> list = new List <RecipientInfoCacheEntry>(100);
                try
                {
                    if (xmlReader.Read())
                    {
                        if (!string.Equals(xmlReader.Name, parentNodeName, StringComparison.OrdinalIgnoreCase))
                        {
                            throw new CorruptDataException(ServerStrings.InvalidTagName(parentNodeName, xmlReader.Name));
                        }
                        if (xmlReader.HasAttributes)
                        {
                            string s = xmlReader["version"];
                            if (!int.TryParse(s, NumberStyles.Any, CultureInfo.InvariantCulture, out backendCacheVersion))
                            {
                                throw new CorruptDataException(ServerStrings.VersionNotInteger);
                            }
                            if (backendCacheVersion < 3)
                            {
                                return(new List <RecipientInfoCacheEntry>(0));
                            }
                        }
                        while (xmlReader.Read() && (xmlReader.NodeType != XmlNodeType.EndElement || !string.Equals(parentNodeName, xmlReader.Name, StringComparison.OrdinalIgnoreCase)))
                        {
                            list.Add(RecipientInfoCacheEntry.ParseEntry(xmlReader));
                        }
                        if (xmlReader.Read())
                        {
                            throw new CorruptDataException(ServerStrings.UnexpectedTag(xmlReader.Name));
                        }
                    }
                }
                catch (XmlException ex)
                {
                    ExTraceGlobals.StorageTracer.TraceDebug <string>(0L, "RecipientInfoCache.Deserialize: Failed. Exception: {0}", ex.Message);
                    throw new CorruptDataException(ServerStrings.InvalidXml, ex);
                }
                result = list;
            }
            return(result);
        }
        // Token: 0x0600109B RID: 4251 RVA: 0x00044010 File Offset: 0x00042210
        private bool AddParticipant(Participant participant)
        {
            E164Number e164Number;

            if (!E164Number.TryParse(participant.EmailAddress, out e164Number))
            {
                return(false);
            }
            for (int i = 0; i < this.CacheEntries.Count; i++)
            {
                RecipientInfoCacheEntry recipientInfoCacheEntry = this.CacheEntries[i];
                E164Number number;
                if (!E164Number.TryParse(recipientInfoCacheEntry.RoutingAddress, out number))
                {
                    this.Tracer.TraceDebug <string>((long)this.GetHashCode(), "There's an invalid phone number in the SMS recipient cache of {0}'s mailbox", this.MailboxSession.MailboxOwner.MailboxInfo.DisplayName);
                }
                else if (SmsRecipientInfoCache.NumbersMatch(e164Number, number))
                {
                    this.CacheEntries[i] = SmsRecipientInfoCache.CreateCacheEntry(participant, e164Number.Number);
                    return(true);
                }
            }
            if (this.CacheEntries.Count < 150)
            {
                this.CacheEntries.Add(SmsRecipientInfoCache.CreateCacheEntry(participant, e164Number.Number));
                return(true);
            }
            int index = 0;

            for (int j = 1; j < this.CacheEntries.Count; j++)
            {
                if (this.CacheEntries[j].DateTimeTicks < this.CacheEntries[index].DateTimeTicks)
                {
                    index = j;
                }
            }
            this.CacheEntries[index] = SmsRecipientInfoCache.CreateCacheEntry(participant, e164Number.Number);
            return(true);
        }