// Token: 0x06000EA2 RID: 3746 RVA: 0x00038194 File Offset: 0x00036394
 internal void Clear()
 {
     ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[RowNotificationHandlerCache::Clear] disposing all row notification handlers");
     try
     {
         OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate()
         {
             if (this.handlerCache == null)
             {
                 throw new OwaInvalidOperationException("this.handlerCache may not be null");
             }
             if (this.channelIdCache == null)
             {
                 throw new OwaInvalidOperationException("this.channelIdCache may not be null");
             }
             foreach (string key in this.handlerCache.Keys)
             {
                 RowNotificationHandler rowNotificationHandler = this.handlerCache[key];
                 ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::Clear] Disposing handler for SubscriptionId: {0}", rowNotificationHandler.SubscriptionId);
                 rowNotificationHandler.Dispose();
             }
             this.handlerCache   = new Dictionary <string, RowNotificationHandler>();
             this.channelIdCache = new Dictionary <string, List <string> >();
         });
     }
     catch (GrayException ex)
     {
         ExTraceGlobals.NotificationsCallTracer.TraceError <string>(0L, "MapiNotificationHandlerBase.Dispose Unable to dispose object.  exception {0}", ex.Message);
     }
 }
 // Token: 0x06000D27 RID: 3367 RVA: 0x0003156C File Offset: 0x0002F76C
 internal override void HandleNotificationInternal(Notification notification, MapiNotificationsLogEvent logEvent, object context)
 {
     lock (base.SyncRoot)
     {
         if (notification == null)
         {
             ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "Received NULL notification");
             logEvent.NullNotification = true;
         }
         else
         {
             QueryNotification queryNotification = (QueryNotification)notification;
             ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, int>((long)this.GetHashCode(), "CalendarItemNotificationHandler received a notification. Type: {0}. Row length: {1}.", queryNotification.EventType, queryNotification.Row.Length);
             string itemProperty = RowNotificationHandler.GetItemProperty <string>(queryNotification, 38);
             if (ObjectClass.IsCalendarItemSeries(itemProperty))
             {
                 ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "CalendarItemNotificationHandler ignored notification for item of class: {0}.", itemProperty);
             }
             else if (base.ProcessErrorNotification(queryNotification))
             {
                 logEvent.InvalidNotification = true;
             }
             else
             {
                 base.Notifier.AddFolderContentChangePayload(base.FolderId, this.GetPayloadFromNotification(base.FolderId, queryNotification));
                 base.Notifier.PickupData();
             }
         }
     }
 }
        // Token: 0x06000D65 RID: 3429 RVA: 0x00032C78 File Offset: 0x00030E78
        private void LoadConversationFeedPropertiesIfRequested(QueryNotification notification, ConversationType conv)
        {
            bool flag   = false;
            int  index  = Array.IndexOf <PropertyDefinition>(this.SubscriptionProperties, ConversationItemSchema.ConversationInitialMemberDocumentId);
            int  index2 = Array.IndexOf <PropertyDefinition>(this.SubscriptionProperties, ConversationItemSchema.ConversationMemberDocumentIds);
            int? initialMemberDocumentId = null;

            int[] memberDocumentIds = null;
            if (RowNotificationHandler.IsPropertyDefined(notification, index))
            {
                initialMemberDocumentId = RowNotificationHandler.GetItemProperty <int?>(notification, index);
                flag = true;
            }
            if (RowNotificationHandler.IsPropertyDefined(notification, index2))
            {
                memberDocumentIds = RowNotificationHandler.GetItemProperty <int[]>(notification, index2);
                flag = true;
            }
            if (flag)
            {
                SimulatedWebRequestContext.Execute(base.UserContext, "LoadConversationFeedPropertiesIfRequested", delegate(MailboxSession mailboxSession, IRecipientSession adSession, RequestDetailsLogger logger)
                {
                    ConversationFeedLoader conversationFeedLoader = new ConversationFeedLoader(mailboxSession, this.TimeZone);
                    conversationFeedLoader.LoadConversationFeedItems(conv, initialMemberDocumentId, memberDocumentIds);
                });
            }
        }
        // Token: 0x06000D2B RID: 3371 RVA: 0x00031AC8 File Offset: 0x0002FCC8
        private double?GetLocationPropertyValue(QueryNotification notification, int index)
        {
            double?itemProperty = RowNotificationHandler.GetItemProperty <double?>(notification, index);

            if (itemProperty == null || double.IsNaN(itemProperty.Value))
            {
                return(null);
            }
            return(itemProperty);
        }
示例#5
0
        // Token: 0x06000F01 RID: 3841 RVA: 0x0003A698 File Offset: 0x00038898
        private PeopleIKnowRowNotificationPayload GetRowNotificationPayload(QueryNotification notification)
        {
            PeopleIKnowRowNotificationPayload emptyPayload = this.GetEmptyPayload();

            emptyPayload.EventType          = notification.EventType;
            emptyPayload.PersonaEmailAdress = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.SubscriptionProperties, MessageItemSchema.SenderSmtpAddress));
            emptyPayload.PersonaUnreadCount = RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.SubscriptionProperties, FolderSchema.UnreadCount));
            emptyPayload.Source             = new MailboxLocation(base.MailboxGuid);
            return(emptyPayload);
        }
示例#6
0
        // Token: 0x06000D20 RID: 3360 RVA: 0x00031050 File Offset: 0x0002F250
        protected string GetDateTimeProperty(QueryNotification notification, int index)
        {
            ExDateTime itemProperty = RowNotificationHandler.GetItemProperty <ExDateTime>(notification, index, ExDateTime.MinValue);

            if (ExDateTime.MinValue.Equals(itemProperty))
            {
                return(null);
            }
            return(ExDateTimeConverter.ToOffsetXsdDateTime(itemProperty, this.timeZone));
        }
示例#7
0
        // Token: 0x06000D14 RID: 3348 RVA: 0x00030B94 File Offset: 0x0002ED94
        protected static T GetItemProperty <T>(QueryNotification notification, int index, T defaultValue)
        {
            if (!RowNotificationHandler.IsPropertyDefined(notification, index))
            {
                return(defaultValue);
            }
            object obj = notification.Row[index];

            if (!(obj is T))
            {
                return(defaultValue);
            }
            return((T)((object)obj));
        }
 // Token: 0x06000E9D RID: 3741 RVA: 0x00037BFC File Offset: 0x00035DFC
 internal void AddHandler(string subscriptionId, RowNotificationHandler handler, string channelId)
 {
     if (subscriptionId == null)
     {
         throw new ArgumentNullException("subscriptionId");
     }
     if (handler == null)
     {
         throw new ArgumentNullException("handler");
     }
     if (this.handlerCache == null)
     {
         throw new OwaInvalidOperationException("this.handlerCache may not be null");
     }
     if (this.channelIdCache == null)
     {
         throw new OwaInvalidOperationException("this.channelIdCache may not be null");
     }
     ExTraceGlobals.NotificationsCallTracer.TraceDebug <string, string, int>((long)this.GetHashCode(), "[RowNotificationHandlerCache::AddHandler] Adding handler for SubscriptionId: {0}. ChannelId: {1}. Current RefCount: {2}", subscriptionId, channelId, handler.RefCount);
     if (!this.handlerCache.ContainsKey(subscriptionId))
     {
         ExTraceGlobals.NotificationsCallTracer.TraceDebug <string, string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::AddHandler] Adding new handler for SubscriptionId: {0}. ChannelId: {1}. New RefCount: 1", subscriptionId, channelId);
         handler.RefCount = 1;
         this.handlerCache[subscriptionId] = handler;
         if (channelId != null)
         {
             this.TryAddSubscriptionIdToChannelIdCache(subscriptionId, channelId);
             return;
         }
     }
     else if (channelId != null)
     {
         bool flag = true;
         if (this.TryAddSubscriptionIdToChannelIdCache(subscriptionId, channelId))
         {
             handler.RefCount++;
             flag = false;
         }
         ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[RowNotificationHandlerCache::AddHandler] Is duplicate subscription request: '{0}' for existing unique view handler. SubscriptionId: {1}. ChannelId: {2}. RefCount: {3}", new object[]
         {
             flag,
             subscriptionId,
             channelId,
             handler.RefCount
         });
     }
 }
        // Token: 0x06000D62 RID: 3426 RVA: 0x000325E4 File Offset: 0x000307E4
        private static PropertyDefinition[] GetSubscriptionProperties(string requestedConversationShapeName, IFeaturesManager featuresManager)
        {
            if (string.IsNullOrEmpty(requestedConversationShapeName))
            {
                requestedConversationShapeName = WellKnownShapeName.ConversationUberListView.ToString();
            }
            ConversationResponseShape clientResponseShape = new ConversationResponseShape(ShapeEnum.IdOnly, new PropertyPath[0]);
            ConversationResponseShape responseShape       = Global.ResponseShapeResolver.GetResponseShape <ConversationResponseShape>(requestedConversationShapeName, clientResponseShape, featuresManager);

            if (responseShape == null)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)requestedConversationShapeName.GetHashCode(), "[ConversationRowNotificationHandler.GetSubscriptionProperties] Unable to resolve requestedConversationShapeName: {0}", requestedConversationShapeName);
                return(ConversationRowNotificationHandler.defaultConversationViewQuerySubscriptionProperties);
            }
            Shape[] shapes = new Shape[]
            {
                ConversationShape.CreateShape()
            };
            PropertyDefinition[] specialConversationProperties = ConversationRowNotificationHandler.GetSpecialConversationProperties(responseShape);
            return(RowNotificationHandler.GetPropertyDefinitionsForResponseShape(shapes, responseShape, specialConversationProperties));
        }
        private static PropertyDefinition[] GetSubscriptionProperties(IFeaturesManager featuresManager)
        {
            string            text = WellKnownShapeName.MailListItem.ToString();
            ItemResponseShape itemResponseShape = new ItemResponseShape();

            itemResponseShape.BaseShape = ShapeEnum.IdOnly;
            ItemResponseShape responseShape = Global.ResponseShapeResolver.GetResponseShape <ItemResponseShape>(text, itemResponseShape, featuresManager);

            if (responseShape == null)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)text.GetHashCode(), "[MessageItemRowNotificationHandler.GetSubscriptionProperties] Unable to resolve shapeName: {0} with features manager", text);
                return(MessageItemRowNotificationHandler.defaultSubscriptionProperties);
            }
            Shape[] shapes = new Shape[]
            {
                ItemShape.CreateShape(),
                    MessageShape.CreateShape(),
                    TaskShape.CreateShape()
            };
            return(RowNotificationHandler.GetPropertyDefinitionsForResponseShape(shapes, responseShape, new PropertyDefinition[0]));
        }
 // Token: 0x06000E9C RID: 3740 RVA: 0x00037B64 File Offset: 0x00035D64
 internal bool TryGetHandler(string subscriptionId, out RowNotificationHandler handler)
 {
     if (subscriptionId == null)
     {
         throw new ArgumentNullException("subscriptionId");
     }
     if (this.handlerCache == null)
     {
         throw new OwaInvalidOperationException("this.handlerCache may not be null");
     }
     if (this.channelIdCache == null)
     {
         throw new OwaInvalidOperationException("this.channelIdCache may not be null");
     }
     handler = null;
     ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::TryGetHandler] TryGetHandle for SubscriptionId: {0}", subscriptionId);
     if (this.handlerCache.ContainsKey(subscriptionId))
     {
         handler = this.handlerCache[subscriptionId];
         ExTraceGlobals.NotificationsCallTracer.TraceDebug <string, int>((long)this.GetHashCode(), "[RowNotificationHandlerCache::TryGetHandler] Found handler for SubscriptionId: {0}. Current RefCount: {1}", subscriptionId, handler.RefCount);
         return(true);
     }
     return(false);
 }
        // Token: 0x06000D28 RID: 3368 RVA: 0x0003165C File Offset: 0x0002F85C
        protected override NotificationPayloadBase GetPayloadFromNotification(StoreObjectId folderId, QueryNotification notification)
        {
            CalendarItemNotificationPayload calendarItemNotificationPayload = new CalendarItemNotificationPayload();

            calendarItemNotificationPayload.FolderId       = StoreId.StoreIdToEwsId(base.MailboxGuid, folderId);
            calendarItemNotificationPayload.SubscriptionId = base.SubscriptionId;
            calendarItemNotificationPayload.EventType      = notification.EventType;
            calendarItemNotificationPayload.Source         = new MailboxLocation(base.MailboxGuid);
            EwsCalendarItemType ewsCalendarItemType = new EwsCalendarItemType();

            ewsCalendarItemType.InstanceKey      = notification.Index;
            calendarItemNotificationPayload.Item = ewsCalendarItemType;
            if (notification.EventType != QueryNotificationType.RowDeleted)
            {
                VersionedId itemProperty = RowNotificationHandler.GetItemProperty <VersionedId>(notification, 0);
                if (itemProperty == null)
                {
                    ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "Invalid StoreId for calendar item notification.");
                    calendarItemNotificationPayload.Reload = true;
                    return(calendarItemNotificationPayload);
                }
                ConcatenatedIdAndChangeKey concatenatedId = IdConverter.GetConcatenatedId(itemProperty, new MailboxId(base.MailboxGuid), null);
                ewsCalendarItemType.ItemId  = new ItemId(concatenatedId.Id, concatenatedId.ChangeKey);
                ewsCalendarItemType.Start   = base.GetDateTimeProperty(notification, 2);
                ewsCalendarItemType.End     = base.GetDateTimeProperty(notification, 3);
                ewsCalendarItemType.Subject = RowNotificationHandler.GetItemProperty <string>(notification, 4);
                ewsCalendarItemType.LegacyFreeBusyStatusString = BusyTypeConverter.ToString((BusyType)RowNotificationHandler.GetItemProperty <int>(notification, 5));
                ewsCalendarItemType.IsAllDayEvent = RowNotificationHandler.GetItemProperty <bool?>(notification, 6);
                ewsCalendarItemType.IsRecurring   = new bool?(RowNotificationHandler.GetItemProperty <byte[]>(notification, 7) != null);
                if (RowNotificationHandler.IsPropertyDefined(notification, 8))
                {
                    ewsCalendarItemType.Organizer = RowNotificationHandler.CreateRecipientFromParticipant((Participant)notification.Row[8]);
                }
                ewsCalendarItemType.IsMeeting            = RowNotificationHandler.GetItemProperty <bool?>(notification, 9);
                ewsCalendarItemType.MyResponseTypeString = ResponseTypeConverter.ToString((ResponseType)RowNotificationHandler.GetItemProperty <int>(notification, 10));
                ewsCalendarItemType.SensitivityString    = SensitivityConverter.ToString(RowNotificationHandler.GetItemProperty <Sensitivity>(notification, 11));
                ewsCalendarItemType.HasAttachments       = RowNotificationHandler.GetItemProperty <bool?>(notification, 12);
                LocationSourceType itemProperty2 = (LocationSourceType)RowNotificationHandler.GetItemProperty <int>(notification, 26);
                ewsCalendarItemType.EnhancedLocation = ((itemProperty2 == LocationSourceType.None) ? new EnhancedLocationType
                {
                    DisplayName = RowNotificationHandler.GetItemProperty <string>(notification, 13),
                    PostalAddress = new Microsoft.Exchange.Services.Core.Types.PostalAddress()
                } : new EnhancedLocationType
                {
                    DisplayName = RowNotificationHandler.GetItemProperty <string>(notification, 24),
                    Annotation = RowNotificationHandler.GetItemProperty <string>(notification, 25),
                    PostalAddress = new Microsoft.Exchange.Services.Core.Types.PostalAddress
                    {
                        LocationSource = itemProperty2,
                        LocationUri = RowNotificationHandler.GetItemProperty <string>(notification, 27),
                        Latitude = this.GetLocationPropertyValue(notification, 28),
                        Longitude = this.GetLocationPropertyValue(notification, 29),
                        Accuracy = this.GetLocationPropertyValue(notification, 30),
                        Altitude = this.GetLocationPropertyValue(notification, 31),
                        AltitudeAccuracy = this.GetLocationPropertyValue(notification, 32),
                        Street = RowNotificationHandler.GetItemProperty <string>(notification, 33),
                        City = RowNotificationHandler.GetItemProperty <string>(notification, 34),
                        State = RowNotificationHandler.GetItemProperty <string>(notification, 35),
                        Country = RowNotificationHandler.GetItemProperty <string>(notification, 36),
                        PostalCode = RowNotificationHandler.GetItemProperty <string>(notification, 37)
                    }
                });
                StoreId itemProperty3 = RowNotificationHandler.GetItemProperty <StoreId>(notification, 14);
                ewsCalendarItemType.ParentFolderId = IdConverter.GetFolderIdFromStoreId(itemProperty3, new MailboxId(base.MailboxGuid));
                byte[] itemProperty4 = RowNotificationHandler.GetItemProperty <byte[]>(notification, 15);
                if (itemProperty4 != null)
                {
                    try
                    {
                        GlobalObjectId globalObjectId = new GlobalObjectId(itemProperty4);
                        ewsCalendarItemType.UID = globalObjectId.Uid;
                    }
                    catch (CorruptDataException ex)
                    {
                        ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)this.GetHashCode(), "Exception setting the UID in CalendarItemNotificationHandler:GetPayloadFromNotification. Exception: {1}", ex.Message);
                    }
                }
                ewsCalendarItemType.AppointmentState       = new int?(RowNotificationHandler.GetItemProperty <int>(notification, 16));
                ewsCalendarItemType.IsCancelled            = new bool?((ewsCalendarItemType.AppointmentState.Value & 4) == 4);
                ewsCalendarItemType.CalendarItemTypeString = CalendarItemTypeConverter.ToString(RowNotificationHandler.GetItemProperty <CalendarItemType>(notification, 17));
                ewsCalendarItemType.AppointmentReplyTime   = base.GetDateTimeProperty(notification, 18);
                if (RowNotificationHandler.IsPropertyDefined(notification, 19))
                {
                    ewsCalendarItemType.JoinOnlineMeetingUrl = RowNotificationHandler.GetItemProperty <string>(notification, 19);
                }
                ewsCalendarItemType.Categories  = RowNotificationHandler.GetItemProperty <string[]>(notification, 20);
                ewsCalendarItemType.IsOrganizer = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, 23));
                ConversationId itemProperty5 = RowNotificationHandler.GetItemProperty <ConversationId>(notification, 21);
                string         id            = IdConverter.ConversationIdToEwsId(base.MailboxGuid, itemProperty5);
                ewsCalendarItemType.ConversationId      = new ItemId(id, null);
                ewsCalendarItemType.IsResponseRequested = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, 22));
                try
                {
                    base.UserContext.LockAndReconnectMailboxSession(3000);
                    ewsCalendarItemType.EffectiveRights = EffectiveRightsProperty.GetFromEffectiveRights(EffectiveRights.Modify | EffectiveRights.Read | EffectiveRights.Delete, base.UserContext.MailboxSession);
                }
                finally
                {
                    if (base.UserContext.MailboxSessionLockedByCurrentThread())
                    {
                        base.UserContext.UnlockAndDisconnectMailboxSession();
                    }
                }
            }
            return(calendarItemNotificationPayload);
        }
        private ItemType GetMessageItemFromNotification(QueryNotification notification)
        {
            ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[MessageItemRowNotificationHandler.GetMessageItemFromNotification] Start. SubscriptionId: {0}", base.SubscriptionId);
            ItemType itemType;

            if (notification.EventType == QueryNotificationType.RowDeleted)
            {
                itemType = new MessageType
                {
                    InstanceKey = notification.Index
                };
            }
            else
            {
                StoreId       itemProperty  = RowNotificationHandler.GetItemProperty <StoreId>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Id));
                StoreObjectId storeObjectId = StoreId.GetStoreObjectId(itemProperty);
                itemType                   = ItemType.CreateFromStoreObjectType(storeObjectId.ObjectType);
                itemType.InstanceKey       = notification.Index;
                itemType.ItemId            = this.StoreIdToEwsItemId(itemProperty);
                itemType.ParentFolderId    = new FolderId(base.GetEwsId(RowNotificationHandler.GetItemProperty <StoreId>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.ParentItemId))), null);
                itemType.ConversationId    = new ItemId(IdConverter.ConversationIdToEwsId(base.MailboxGuid, RowNotificationHandler.GetItemProperty <ConversationId>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ConversationId))), null);
                itemType.Subject           = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Subject));
                itemType.ImportanceString  = RowNotificationHandler.GetItemProperty <Importance>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Importance), Importance.Normal).ToString();
                itemType.SensitivityString = RowNotificationHandler.GetItemProperty <Sensitivity>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Sensitivity), Sensitivity.Normal).ToString();
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedTime)))
                {
                    itemType.DateTimeReceived = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedTime));
                }
                itemType.HasAttachments = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.HasAttachment)));
                itemType.IsDraft        = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemSchema.IsDraft)));
                itemType.ItemClass      = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.ItemClass));
                MessageType messageType = itemType as MessageType;
                if (messageType != null)
                {
                    if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.From)))
                    {
                        messageType.From = RowNotificationHandler.CreateRecipientFromParticipant((Participant)notification.Row[Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.From)]);
                    }
                    if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Sender)))
                    {
                        messageType.Sender = RowNotificationHandler.CreateRecipientFromParticipant((Participant)notification.Row[Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Sender)]);
                    }
                    messageType.IsRead = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemSchema.IsRead)));
                }
                FlagType flagType = new FlagType();
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.CompleteDate)))
                {
                    flagType.CompleteDate = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.CompleteDate));
                }
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.FlagStatus)))
                {
                    flagType.FlagStatus = RowNotificationHandler.GetItemProperty <FlagStatus>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.FlagStatus), FlagStatus.NotFlagged);
                }
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.StartDate)))
                {
                    flagType.StartDate = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.StartDate));
                }
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.DueDate)))
                {
                    flagType.DueDate = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.DueDate));
                }
                itemType.Flag = flagType;
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.CreationTime)))
                {
                    itemType.DateTimeCreated = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.CreationTime));
                }
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.LastModifiedTime)))
                {
                    itemType.LastModifiedTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.LastModifiedTime));
                }
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedOrRenewTime)))
                {
                    itemType.ReceivedOrRenewTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedOrRenewTime));
                }
                itemType.Categories = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Categories));
                itemType.Preview    = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Preview), null);
                itemType.Size       = RowNotificationHandler.GetItemProperty <int?>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Size), null);
                itemType.AddExtendedPropertyValue(new ExtendedPropertyType(WellKnownProperties.NormalizedSubject, RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.normalizedSubjectPropertyDefinition), null)));
                itemType.DisplayTo = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.DisplayTo), null);
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.IconIndex)))
                {
                    IconIndex itemProperty2 = (IconIndex)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.IconIndex));
                    if (itemProperty2 > (IconIndex)0)
                    {
                        itemType.IconIndexString = itemProperty2.ToString();
                    }
                }
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.SentTime)))
                {
                    itemType.DateTimeSent = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.SentTime));
                }
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutedPropertyDefinition)))
                {
                    itemType.AddExtendedPropertyValue(new ExtendedPropertyType(WellKnownProperties.LastVerbExecuted, RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutedPropertyDefinition)).ToString()));
                }
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutionTimePropertyDefinition)))
                {
                    itemType.AddExtendedPropertyValue(new ExtendedPropertyType(WellKnownProperties.LastVerbExecutionTime, base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutionTimePropertyDefinition))));
                }
                ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[MessageItemRowNotificationHandler.GetMessageItemFromNotification] End. SubscriptionId: {0}", base.SubscriptionId);
            }
            return(itemType);
        }
        // Token: 0x06000D5C RID: 3420 RVA: 0x0003243C File Offset: 0x0003063C
        static ConversationRowNotificationHandler()
        {
            Shape[] shapes = new Shape[]
            {
                ConversationShape.CreateShape()
            };
            ResponseShape responseShape = WellKnownShapes.ResponseShapes[WellKnownShapeName.ConversationUberListView];

            ConversationRowNotificationHandler.defaultConversationViewQuerySubscriptionProperties = RowNotificationHandler.GetPropertyDefinitionsForResponseShape(shapes, responseShape, new PropertyDefinition[]
            {
                ConversationItemSchema.ConversationPreview
            });
        }
        // Token: 0x06000D64 RID: 3428 RVA: 0x00032724 File Offset: 0x00030924
        private ConversationType GetConversationFromNotification(QueryNotification notification)
        {
            ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[ConversationRowNotificationHandler.GetConversationFromNotification] Start. SubscriptionId: {0}", base.SubscriptionId);
            ConversationType conv = new ConversationType();

            conv.InstanceKey = notification.Index;
            if (notification.EventType != QueryNotificationType.RowDeleted)
            {
                conv.ConversationId          = new ItemId(IdConverter.ConversationIdToEwsId(base.MailboxGuid, RowNotificationHandler.GetItemProperty <ConversationId>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationId))), null);
                conv.ConversationTopic       = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationTopic));
                conv.UniqueRecipients        = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMVTo));
                conv.UniqueSenders           = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMVFrom));
                conv.LastDeliveryTime        = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationLastDeliveryTime));
                conv.LastDeliveryOrRenewTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationLastDeliveryOrRenewTime));
                conv.Categories = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationCategories));
                FlagType flagType = new FlagType();
                if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationFlagStatus)))
                {
                    flagType.FlagStatus = (FlagStatus)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationFlagStatus), 0);
                }
                conv.FlagStatus         = flagType.FlagStatus;
                conv.HasAttachments     = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationHasAttach)));
                conv.HasIrm             = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationHasIrm)));
                conv.MessageCount       = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMessageCount)));
                conv.GlobalMessageCount = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalMessageCount)));
                conv.UnreadCount        = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationUnreadMessageCount)));
                conv.GlobalUnreadCount  = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalUnreadMessageCount)));
                conv.Size             = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMessageSize)));
                conv.ItemClasses      = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMessageClasses));
                conv.ImportanceString = ((ImportanceType)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationImportance), 1)).ToString();
                StoreId[] itemProperty = RowNotificationHandler.GetItemProperty <StoreId[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationItemIds), new StoreId[0]);
                conv.ItemIds = Array.ConvertAll <StoreId, ItemId>(itemProperty, (StoreId s) => new ItemId(base.GetEwsId(s), null));
                StoreId[] itemProperty2 = RowNotificationHandler.GetItemProperty <StoreId[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalItemIds), new StoreId[0]);
                conv.GlobalItemIds = Array.ConvertAll <StoreId, ItemId>(itemProperty2, (StoreId s) => new ItemId(base.GetEwsId(s), null));
                conv.DraftStoreIds = from storeId in itemProperty2
                                     where DraftItemIdsProperty.IsItemInDraftsFolder(storeId, this.draftFolderId)
                                     select StoreId.GetStoreObjectId(storeId);

                if (conv.DraftStoreIds.FirstOrDefault <StoreId>() != null)
                {
                    SimulatedWebRequestContext.Execute(base.UserContext, "ConversationNotificationDraftItemIds", delegate(MailboxSession mailboxSession, IRecipientSession adSession, RequestDetailsLogger logger)
                    {
                        NormalQueryView.PrepareDraftItemIds(mailboxSession, new ConversationType[]
                        {
                            conv
                        });
                    });
                }
                conv.LastModifiedTime   = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, StoreObjectSchema.LastModifiedTime));
                conv.Preview            = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationPreview));
                conv.MailboxScopeString = MailboxSearchLocation.PrimaryOnly.ToString();
                IconIndex itemProperty3 = (IconIndex)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationReplyForwardState));
                if (itemProperty3 > (IconIndex)0)
                {
                    conv.IconIndexString = itemProperty3.ToString();
                }
                itemProperty3 = (IconIndex)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalReplyForwardState));
                if (itemProperty3 > (IconIndex)0)
                {
                    conv.GlobalIconIndexString = itemProperty3.ToString();
                }
                this.LoadConversationFeedPropertiesIfRequested(notification, conv);
                ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[ConversationRowNotificationHandler.GetConversationFromNotification] End. SubscriptionId: {0}", base.SubscriptionId);
            }
            return(conv);
        }
            // Token: 0x06000E9E RID: 3742 RVA: 0x00037D0C File Offset: 0x00035F0C
            internal void ReleaseHandler(string subscriptionId, string channelId)
            {
                if (subscriptionId == null)
                {
                    throw new ArgumentNullException("subscriptionId");
                }
                if (this.handlerCache == null)
                {
                    throw new OwaInvalidOperationException("this.handlerCache may not be null");
                }
                if (this.channelIdCache == null)
                {
                    throw new OwaInvalidOperationException("this.channelIdCache may not be null");
                }
                RowNotificationHandler rowNotificationHandler = null;

                if (this.handlerCache.TryGetValue(subscriptionId, out rowNotificationHandler))
                {
                    ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[RowNotificationHandlerCache::ReleaseHandler] releasing handler for SubscriptionId: {0} ChannelId: {1} Old RefCount: {2} New RefCount: {3}", new object[]
                    {
                        rowNotificationHandler.SubscriptionId,
                        channelId,
                        rowNotificationHandler.RefCount,
                        rowNotificationHandler.RefCount - 1
                    });
                    if (--rowNotificationHandler.RefCount == 0)
                    {
                        ExTraceGlobals.NotificationsCallTracer.TraceDebug <string, string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::ReleaseHandler] Disposing handler for SubscriptionId: {0} ChannelId: {1}", subscriptionId, channelId);
                        this.handlerCache.Remove(subscriptionId);
                        if (!this.userContext.MailboxSessionLockedByCurrentThread())
                        {
                            try
                            {
                                try
                                {
                                    this.userContext.LockAndReconnectMailboxSession(3000);
                                    rowNotificationHandler.Dispose();
                                    rowNotificationHandler = null;
                                }
                                catch (OwaLockTimeoutException)
                                {
                                    ExTraceGlobals.NotificationsCallTracer.TraceDebug <string, string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::ReleaseHandler] Disposing handler for SubscriptionId: {0} ChannelId: {1} Failed to acquire mbx lock", subscriptionId, channelId);
                                }
                                catch (StoragePermanentException ex)
                                {
                                    ExTraceGlobals.UserContextTracer.TraceError <string>(0L, "[RowNotificationHandlerCache::ReleaseHandler]. Unable to dispose object.  exception {0}", ex.Message);
                                }
                                catch (StorageTransientException ex2)
                                {
                                    ExTraceGlobals.UserContextTracer.TraceError <string>(0L, "[RowNotificationHandlerCache::ReleaseHandler]. Unable to dispose object.  exception {0}", ex2.Message);
                                }
                                goto IL_15C;
                            }
                            finally
                            {
                                this.userContext.UnlockAndDisconnectMailboxSession();
                            }
                        }
                        rowNotificationHandler.Dispose();
                        rowNotificationHandler = null;
                    }
                }
IL_15C:
                if (channelId == null)
                {
                    ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::ReleaseHandler] Returning without updating channel id lookup cache for non-unique view handler for SubscriptionId: {0}. ChannelId is null.", subscriptionId);
                    return;
                }
                this.RemoveSubscriptionIdFromChannelIdCache(subscriptionId, channelId);
            }
 // Token: 0x06000E82 RID: 3714 RVA: 0x00036E28 File Offset: 0x00035028
 public void SubscribeToRowNotification(string subscriptionId, SubscriptionParameters parameters, ExTimeZone timeZone, CallContext callContext, bool remoteSubscription)
 {
     if (parameters == null)
     {
         throw new ArgumentNullException("parameters");
     }
     if (parameters.FolderId == null)
     {
         throw new OwaInvalidOperationException("Folder Id must be specified when subscribing to row notifications");
     }
     if (subscriptionId == null)
     {
         throw new ArgumentNullException("subscriptionId");
     }
     if (timeZone == null)
     {
         throw new ArgumentNullException("timeZone");
     }
     lock (this.syncRoot)
     {
         if (!this.isDisposed)
         {
             ExTraceGlobals.NotificationsCallTracer.TraceDebug <UserContextKey, string, string>((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] START userContextKey: {0} SubscriptionId: {1} ChannelId: {2}", this.userContext.Key, subscriptionId, parameters.ChannelId);
             RowNotificationHandler rowNotificationHandler = null;
             this.rowNotificationHandlerCache.TryGetHandler(subscriptionId, out rowNotificationHandler);
             if (rowNotificationHandler == null)
             {
                 StoreObjectId storeObjectId = StoreId.EwsIdToStoreObjectId(parameters.FolderId);
                 if (storeObjectId == null)
                 {
                     throw new OwaInvalidOperationException("Invalid Folder Id. Could not be converted to a storeFolderId");
                 }
                 if (parameters.NotificationType == NotificationType.CalendarItemNotification)
                 {
                     rowNotificationHandler = new CalendarItemNotificationHandler(subscriptionId, parameters, storeObjectId, this.userContext, this.userContext.ExchangePrincipal.MailboxInfo.MailboxGuid, timeZone, remoteSubscription);
                 }
                 else if (parameters.NotificationType == NotificationType.PeopleIKnowNotification)
                 {
                     rowNotificationHandler = new PeopleIKnowRowNotificationHandler(subscriptionId, parameters, storeObjectId, this.userContext, this.userContext.ExchangePrincipal.MailboxInfo.MailboxGuid, timeZone, callContext.ClientCulture);
                 }
                 else if (parameters.IsConversation)
                 {
                     UserContext fullUserContext = this.GetFullUserContext("Conversation row notification");
                     rowNotificationHandler = new ConversationRowNotificationHandler(subscriptionId, parameters, storeObjectId, this.userContext, this.userContext.ExchangePrincipal.MailboxInfo.MailboxGuid, timeZone, remoteSubscription, fullUserContext.FeaturesManager);
                 }
                 else
                 {
                     UserContext fullUserContext2 = this.GetFullUserContext("MessageItem row notification");
                     rowNotificationHandler = new MessageItemRowNotificationHandler(subscriptionId, parameters, storeObjectId, this.userContext, this.userContext.ExchangePrincipal.MailboxInfo.MailboxGuid, timeZone, fullUserContext2.FeaturesManager);
                 }
                 try
                 {
                     ExTraceGlobals.NotificationsCallTracer.TraceDebug <UserContextKey, string, string>((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] userContextKey: {0} New subscription for subscriptionId: {1} ChannelId: {2}", this.userContext.Key, subscriptionId, parameters.ChannelId);
                     this.WireConnectionDroppedHandler(rowNotificationHandler);
                     rowNotificationHandler.Subscribe();
                     rowNotificationHandler.OnBeforeDisposed += this.BeforeDisposeRowNotificationHandler;
                     this.rowNotificationHandlerCache.AddHandler(subscriptionId, rowNotificationHandler, parameters.ChannelId);
                     rowNotificationHandler = null;
                     goto IL_319;
                 }
                 finally
                 {
                     if (rowNotificationHandler != null)
                     {
                         try
                         {
                             this.userContext.LockAndReconnectMailboxSession(3000);
                             rowNotificationHandler.Dispose();
                             rowNotificationHandler = null;
                         }
                         catch (OwaLockTimeoutException ex)
                         {
                             ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] User context lock timed out in attempt to dispose handler. Exception: {0}", ex.Message);
                         }
                         finally
                         {
                             if (this.userContext.MailboxSessionLockedByCurrentThread())
                             {
                                 this.userContext.UnlockAndDisconnectMailboxSession();
                             }
                         }
                     }
                 }
             }
             ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] userContextKey: {0} Reusing existing notification handler subscriptionId: {1} ChannelId: {2} Current RefCount: {3}. Setting MissedNotifications = false", new object[]
             {
                 this.userContext.Key,
                 subscriptionId,
                 parameters.ChannelId,
                 rowNotificationHandler.RefCount
             });
             rowNotificationHandler.MissedNotifications = false;
             if (rowNotificationHandler.NeedToReinitSubscriptions)
             {
                 ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] userContextKey: {0} Need to re-init subscriptionId: {1} ChannelId: {2} Refcount: {3}", new object[]
                 {
                     this.userContext.Key,
                     subscriptionId,
                     parameters.ChannelId,
                     rowNotificationHandler.RefCount
                 });
                 rowNotificationHandler.Subscribe();
             }
             this.rowNotificationHandlerCache.AddHandler(subscriptionId, rowNotificationHandler, parameters.ChannelId);
         }
         IL_319 :;
     }
 }
        static MessageItemRowNotificationHandler()
        {
            Shape[] shapes = new Shape[]
            {
                ItemShape.CreateShape(),
                    MessageShape.CreateShape(),
                    TaskShape.CreateShape()
            };
            ResponseShape responseShape = WellKnownShapes.ResponseShapes[WellKnownShapeName.MailListItem];

            MessageItemRowNotificationHandler.defaultSubscriptionProperties           = RowNotificationHandler.GetPropertyDefinitionsForResponseShape(shapes, responseShape, new PropertyDefinition[0]);
            MessageItemRowNotificationHandler.normalizedSubjectPropertyDefinition     = WellKnownProperties.NormalizedSubject.ToPropertyDefinition();
            MessageItemRowNotificationHandler.lastVerbExecutedPropertyDefinition      = WellKnownProperties.LastVerbExecuted.ToPropertyDefinition();
            MessageItemRowNotificationHandler.lastVerbExecutionTimePropertyDefinition = WellKnownProperties.LastVerbExecutionTime.ToPropertyDefinition();
        }
示例#19
0
        // Token: 0x06000F60 RID: 3936 RVA: 0x0003BCB8 File Offset: 0x00039EB8
        private static ItemType GetItemFromDataRow(OwaSearchContext searchContext, MailboxSession mailboxSession, object[] row, Dictionary <PropertyDefinition, int> orderDictionary)
        {
            StoreId       itemProperty  = SearchFolderDataRetrieverBase.GetItemProperty <StoreId>(row, orderDictionary[ItemSchema.Id], null);
            StoreObjectId storeObjectId = StoreId.GetStoreObjectId(itemProperty);
            ItemType      itemType      = ItemType.CreateFromStoreObjectType(storeObjectId.ObjectType);

            itemType.ItemId = SearchFolderDataRetrieverBase.StoreIdToEwsItemId(itemProperty, new MailboxId(mailboxSession.MailboxGuid, false));
            byte[] itemProperty2 = SearchFolderDataRetrieverBase.GetItemProperty <byte[]>(row, orderDictionary[ItemSchema.InstanceKey], new byte[0]);
            itemType.InstanceKey       = itemProperty2;
            itemType.InstanceKeyString = Convert.ToBase64String(itemProperty2);
            itemType.ParentFolderId    = new FolderId(SearchFolderDataRetrieverBase.GetEwsId(SearchFolderDataRetrieverBase.GetItemProperty <StoreId>(row, orderDictionary[StoreObjectSchema.ParentItemId], null), mailboxSession.MailboxGuid), null);
            itemType.ConversationId    = new ItemId(IdConverter.ConversationIdToEwsId(mailboxSession.MailboxGuid, SearchFolderDataRetrieverBase.GetItemProperty <ConversationId>(row, orderDictionary[ItemSchema.ConversationId], null)), null);
            itemType.Subject           = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ItemSchema.Subject], string.Empty);
            itemType.ImportanceString  = SearchFolderDataRetrieverBase.GetItemProperty <Importance>(row, orderDictionary[ItemSchema.Importance], Importance.Normal).ToString();
            itemType.SensitivityString = SearchFolderDataRetrieverBase.GetItemProperty <Sensitivity>(row, orderDictionary[ItemSchema.Sensitivity], Sensitivity.Normal).ToString();
            string dateTimeProperty = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[ItemSchema.ReceivedTime]);

            if (!string.IsNullOrEmpty(dateTimeProperty))
            {
                itemType.DateTimeReceived = dateTimeProperty;
            }
            string dateTimeProperty2 = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[ItemSchema.SentTime]);

            if (!string.IsNullOrEmpty(dateTimeProperty2))
            {
                itemType.DateTimeSent = dateTimeProperty2;
            }
            itemType.HasAttachments = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[ItemSchema.HasAttachment], false));
            itemType.IsDraft        = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[MessageItemSchema.IsDraft], false));
            itemType.ItemClass      = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[StoreObjectSchema.ItemClass], string.Empty);
            itemType.Preview        = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ItemSchema.Preview], string.Empty);
            MessageType messageType = itemType as MessageType;

            if (messageType != null)
            {
                Participant itemProperty3 = SearchFolderDataRetrieverBase.GetItemProperty <Participant>(row, orderDictionary[ItemSchema.From], null);
                if (itemProperty3 != null)
                {
                    messageType.From = RowNotificationHandler.CreateRecipientFromParticipant(itemProperty3);
                }
                Participant itemProperty4 = SearchFolderDataRetrieverBase.GetItemProperty <Participant>(row, orderDictionary[ItemSchema.Sender], null);
                if (itemProperty4 != null)
                {
                    messageType.Sender = RowNotificationHandler.CreateRecipientFromParticipant(itemProperty4);
                }
                messageType.IsRead = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[MessageItemSchema.IsRead], false));
            }
            IconIndex itemProperty5 = SearchFolderDataRetrieverBase.GetItemProperty <IconIndex>(row, orderDictionary[ItemSchema.IconIndex], IconIndex.Default);

            if (itemProperty5 != IconIndex.Default)
            {
                itemType.IconIndexString = itemProperty5.ToString();
            }
            FlagType flagType = new FlagType();

            itemType.Flag             = flagType;
            flagType.FlagStatus       = SearchFolderDataRetrieverBase.GetItemProperty <FlagStatus>(row, orderDictionary[ItemSchema.FlagStatus], FlagStatus.NotFlagged);
            itemType.DateTimeCreated  = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[StoreObjectSchema.CreationTime]);
            itemType.LastModifiedTime = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[StoreObjectSchema.LastModifiedTime]);
            itemType.Size             = SearchFolderDataRetrieverBase.GetItemProperty <int?>(row, orderDictionary[ItemSchema.Size], null);
            itemType.DisplayTo        = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ItemSchema.DisplayTo], null);
            itemType.Categories       = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ItemSchema.Categories], null);
            return(itemType);
        }
示例#20
0
 // Token: 0x06000D13 RID: 3347 RVA: 0x00030B74 File Offset: 0x0002ED74
 protected static T GetItemProperty <T>(QueryNotification notification, int index)
 {
     return(RowNotificationHandler.GetItemProperty <T>(notification, index, default(T)));
 }