// Token: 0x0600191C RID: 6428 RVA: 0x00092254 File Offset: 0x00090454
        private Folder GetFolderFromId(OwaStoreObjectId owaStoreObjectId)
        {
            Folder result = null;

            try
            {
                result = Utilities.GetFolder <Folder>(this.userContext, owaStoreObjectId, this.folderViewProperties);
            }
            catch (ObjectNotFoundException)
            {
                ExTraceGlobals.WebPartRequestTracer.TraceDebug <string>(0L, "Web part request could not bind to folder {0}.  User may not have sufficient folder permissions", owaStoreObjectId.ToBase64String());
            }
            return(result);
        }
        public string ReadDataAndResetState()
        {
            string result = null;

            ExTraceGlobals.CoreCallTracer.TraceDebug <string>((long)this.GetHashCode(), "EmailPayload.ReadDataAndResetState. Mailbox: {0}", this.mailboxSessionDisplayName);
            lock (this)
            {
                this.containsDataToPickup = false;
                if (this.payloadStringRefreshAll.Length > 0)
                {
                    result = this.payloadStringRefreshAll.ToString();
                }
                else
                {
                    StringBuilder stringBuilder  = null;
                    StringBuilder stringBuilder2 = null;
                    if (this.folderCountTable.Count > 0)
                    {
                        stringBuilder = new StringBuilder();
                        using (StringWriter stringWriter = new StringWriter(stringBuilder, CultureInfo.InvariantCulture))
                        {
                            foreach (KeyValuePair <OwaStoreObjectId, ItemCountPair> keyValuePair in this.folderCountTable)
                            {
                                OwaStoreObjectId key   = keyValuePair.Key;
                                ItemCountPair    value = keyValuePair.Value;
                                stringWriter.Write("updMapiCnt(\"");
                                Utilities.JavascriptEncode(key.ToBase64String(), stringWriter);
                                stringWriter.Write(string.Concat(new object[]
                                {
                                    "\",",
                                    value.ItemCount,
                                    ",",
                                    value.UnreadItemCount,
                                    ");"
                                }));
                            }
                        }
                    }
                    stringBuilder2 = new StringBuilder();
                    if (this.folderRefreshList.Count > 0)
                    {
                        using (StringWriter stringWriter2 = new StringWriter(stringBuilder2, CultureInfo.InvariantCulture))
                        {
                            foreach (OwaStoreObjectId owaStoreObjectId in this.folderRefreshList)
                            {
                                if (!this.folderContentChangeNotifications.ContainsKey(owaStoreObjectId) || this.folderContentChangeNotifications[owaStoreObjectId].NotificationHandler == null || this.folderContentChangeNotifications[owaStoreObjectId].NotificationHandler.AllowFolderRefreshNotification)
                                {
                                    stringWriter2.Write("stMapiDrty(\"");
                                    Utilities.JavascriptEncode(owaStoreObjectId.ToBase64String(), stringWriter2);
                                    stringWriter2.Write("\");");
                                }
                            }
                        }
                    }
                    int num = 0;
                    if (this.folderContentChangeNotifications.Count > 0)
                    {
                        foreach (EmailPayload.FCNHState fcnhstate in this.folderContentChangeNotifications.Values)
                        {
                            num += fcnhstate.Queue.Count;
                        }
                    }
                    StringBuilder stringBuilder3 = null;
                    bool          flag2          = true;
                    if (num > 0)
                    {
                        stringBuilder3 = new StringBuilder(1280 * num);
                        using (StringWriter stringWriter3 = new StringWriter(stringBuilder3, CultureInfo.InvariantCulture))
                        {
                            foreach (KeyValuePair <OwaStoreObjectId, EmailPayload.FCNHState> keyValuePair2 in this.folderContentChangeNotifications)
                            {
                                OwaStoreObjectId          key2  = keyValuePair2.Key;
                                Queue <QueryNotification> queue = keyValuePair2.Value.Queue;
                                FolderContentChangeNotificationHandler notificationHandler = keyValuePair2.Value.NotificationHandler;
                                foreach (QueryNotification notification in queue)
                                {
                                    notificationHandler.ProcessNotification(stringWriter3, notification, out flag2);
                                }
                            }
                        }
                    }
                    result = string.Concat(new string[]
                    {
                        (stringBuilder != null) ? stringBuilder.ToString() : string.Empty,
                        (stringBuilder2 != null) ? stringBuilder2.ToString() : string.Empty,
                        this.payloadStringReminderChanges.ToString(),
                        this.payloadStringNewMail.ToString(),
                        this.payloadStringQuota.ToString(),
                        this.payloadStringReminderNotify.ToString(),
                        (stringBuilder3 != null) ? stringBuilder3.ToString() : string.Empty
                    });
                }
                this.Clear(true);
            }
            return(result);
        }