Example #1
0
        // Token: 0x06000F5C RID: 3932 RVA: 0x0003B790 File Offset: 0x00039990
        private static ConversationType GetConversationFromDataRow(OwaSearchContext searchContext, MailboxSession mailboxSession, object[] row, Dictionary <PropertyDefinition, int> orderDictionary)
        {
            ConversationType conversationType = new ConversationType();

            conversationType.InstanceKey = SearchFolderDataRetrieverBase.GetItemProperty <byte[]>(row, orderDictionary[ItemSchema.InstanceKey], null);
            ConversationId itemProperty = SearchFolderDataRetrieverBase.GetItemProperty <ConversationId>(row, orderDictionary[ConversationItemSchema.ConversationId], null);

            conversationType.ConversationId    = new ItemId(IdConverter.ConversationIdToEwsId(mailboxSession.MailboxGuid, itemProperty), null);
            conversationType.ConversationTopic = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ConversationItemSchema.ConversationTopic]);
            conversationType.UniqueRecipients  = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ConversationItemSchema.ConversationMVTo]);
            conversationType.UniqueSenders     = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ConversationItemSchema.ConversationMVFrom]);
            conversationType.LastDeliveryTime  = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[ConversationItemSchema.ConversationLastDeliveryTime]);
            conversationType.Categories        = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ConversationItemSchema.ConversationCategories]);
            if (SearchFolderDataRetrieverBase.IsPropertyDefined(row, orderDictionary[ConversationItemSchema.ConversationFlagStatus]))
            {
                FlagStatus itemProperty2 = (FlagStatus)SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationFlagStatus], 0);
                if (itemProperty2 != FlagStatus.NotFlagged)
                {
                    conversationType.FlagStatus = new FlagType
                    {
                        FlagStatus = itemProperty2
                    }.FlagStatus;
                }
            }
            conversationType.HasAttachments     = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[ConversationItemSchema.ConversationHasAttach]));
            conversationType.HasIrm             = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[ConversationItemSchema.ConversationHasIrm]));
            conversationType.MessageCount       = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationMessageCount]));
            conversationType.GlobalMessageCount = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationGlobalMessageCount]));
            conversationType.UnreadCount        = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationUnreadMessageCount]));
            conversationType.GlobalUnreadCount  = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationGlobalUnreadMessageCount]));
            conversationType.Size             = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationMessageSize]));
            conversationType.ItemClasses      = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ConversationItemSchema.ConversationMessageClasses]);
            conversationType.ImportanceString = ((ImportanceType)SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationImportance], 1)).ToString();
            StoreId[] itemProperty3 = SearchFolderDataRetrieverBase.GetItemProperty <StoreId[]>(row, orderDictionary[ConversationItemSchema.ConversationItemIds], new StoreId[0]);
            conversationType.ItemIds = Array.ConvertAll <StoreId, ItemId>(itemProperty3, (StoreId s) => new ItemId(SearchFolderDataRetrieverBase.GetEwsId(s, mailboxSession.MailboxGuid), null));
            StoreId[] itemProperty4 = SearchFolderDataRetrieverBase.GetItemProperty <StoreId[]>(row, orderDictionary[ConversationItemSchema.ConversationGlobalItemIds], new StoreId[0]);
            conversationType.GlobalItemIds    = Array.ConvertAll <StoreId, ItemId>(itemProperty4, (StoreId s) => new ItemId(SearchFolderDataRetrieverBase.GetEwsId(s, mailboxSession.MailboxGuid), null));
            conversationType.LastModifiedTime = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[StoreObjectSchema.LastModifiedTime]);
            conversationType.Preview          = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ConversationItemSchema.ConversationPreview]);
            IconIndex itemProperty5 = (IconIndex)SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationReplyForwardState]);

            if (itemProperty5 > (IconIndex)0)
            {
                conversationType.IconIndexString = itemProperty5.ToString();
            }
            itemProperty5 = (IconIndex)SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationGlobalReplyForwardState]);
            if (itemProperty5 > (IconIndex)0)
            {
                conversationType.GlobalIconIndexString = itemProperty5.ToString();
            }
            return(conversationType);
        }
        protected static T GetItemProperty <T>(object[] row, int index, T defaultValue)
        {
            if (!SearchFolderDataRetrieverBase.IsPropertyDefined(row, index))
            {
                return(defaultValue);
            }
            object obj = row[index];

            if (!(obj is T))
            {
                return(defaultValue);
            }
            return((T)((object)obj));
        }