Example #1
0
        // Token: 0x06002168 RID: 8552 RVA: 0x00079F34 File Offset: 0x00078134
        private void SetDefaultFolderMapping(MailboxSession session)
        {
            DefaultFolderType[] array = (DefaultFolderType[])Enum.GetValues(typeof(DefaultFolderType));
            this.defaultFolderIds   = new FolderId[array.Length];
            this.defaultFolderNames = new string[array.Length];
            int num = 0;
            Dictionary <DefaultFolderType, string> defaultFolderTypeToFolderNameMapForMailbox = IdConverter.GetDefaultFolderTypeToFolderNameMapForMailbox();

            DefaultFolderType[] array2 = array;
            int i = 0;

            while (i < array2.Length)
            {
                DefaultFolderType defaultFolderType = array2[i];
                if (defaultFolderType == DefaultFolderType.None)
                {
                    this.defaultFolderNames[num] = Enum.GetName(typeof(DefaultFolderType), defaultFolderType);
                    goto IL_7E;
                }
                if (defaultFolderTypeToFolderNameMapForMailbox.TryGetValue(defaultFolderType, out this.defaultFolderNames[num]))
                {
                    goto Block_2;
                }
IL_B8:
                i++;
                continue;
Block_2:
                try
                {
IL_7E:
                    StoreObjectId defaultFolderId = session.GetDefaultFolderId(defaultFolderType);
                    if (defaultFolderId == null)
                    {
                        this.defaultFolderIds[num] = null;
                    }
                    else
                    {
                        this.defaultFolderIds[num] = IdConverter.ConvertStoreFolderIdToFolderId(defaultFolderId, session);
                    }
                }
                catch (InvalidOperationException)
                {
                    this.defaultFolderIds[num] = null;
                }
                num++;
                goto IL_B8;
            }
        }