Example #1
0
        // Token: 0x06000F05 RID: 3845 RVA: 0x0003A7D0 File Offset: 0x000389D0
        private PeopleIKnowRowNotificationPayload GetQueryResultChangedPayload(QueryNotificationType queryNotificationType)
        {
            PeopleIKnowRowNotificationPayload emptyPayload = this.GetEmptyPayload();

            emptyPayload.EventType = queryNotificationType;
            this.SetPayloadOnQueryResultChangedNotification(emptyPayload);
            return(emptyPayload);
        }
Example #2
0
 internal QueryNotification(QueryNotificationType eventType, int errorCode, byte[] index, byte[] prior, ICollection <PropertyDefinition> propertyDefinitions, object[] row) : base(NotificationType.Query)
 {
     this.propertyDefinitions = propertyDefinitions;
     this.eventType           = eventType;
     this.errorCode           = errorCode;
     this.index = index;
     this.prior = prior;
     this.row   = row;
 }
        // Token: 0x0600146D RID: 5229 RVA: 0x0007CBE0 File Offset: 0x0007ADE0
        private void AddRowData(TextWriter writer, QueryNotificationType notificationType, ListViewContents2.ListViewRowType rowTypeToRender)
        {
            bool          renderContainer = notificationType != QueryNotificationType.RowModified;
            bool          showFlag        = this.ItemList.ViewDescriptor.ContainsColumn(ColumnId.FlagDueDate);
            StringBuilder stringBuilder   = new StringBuilder(1280);

            using (StringWriter stringWriter = new StringWriter(stringBuilder, CultureInfo.InvariantCulture))
            {
                this.ItemList.RenderRow(stringWriter, showFlag, rowTypeToRender, renderContainer);
            }
            Utilities.JavascriptEncode(stringBuilder.ToString(), writer, true);
            stringBuilder.Length = 0;
        }
Example #4
0
        // Token: 0x06000D11 RID: 3345 RVA: 0x00030838 File Offset: 0x0002EA38
        internal override void HandleNotificationInternal(Notification notification, MapiNotificationsLogEvent logEvent, object context)
        {
            ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification row notification received. User: {0}. SubscriptionId: {1}", base.UserContext.PrimarySmtpAddress, base.SubscriptionId);
            lock (base.SyncRoot)
            {
                if (base.IsDisposed_Reentrant)
                {
                    ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "RowNotificationHandlerBase.HandleNotificationInternal for {0}: Ignoring notification because we're disposed (reentrant).", base.GetType().Name);
                }
                else if (notification == null)
                {
                    ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: Received a null Row Notification object for user {0} SubscriptionId: {1}", base.UserContext.PrimarySmtpAddress, base.SubscriptionId);
                    logEvent.NullNotification = true;
                }
                else
                {
                    QueryNotification queryNotification = (QueryNotification)notification;
                    if (this.ProcessErrorNotification(queryNotification))
                    {
                        ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: Received a invalid Row Notification object for user {0} SubscriptionId: {1}", base.UserContext.PrimarySmtpAddress, base.SubscriptionId);
                        logEvent.InvalidNotification = true;
                    }
                    else
                    {
                        QueryNotificationType eventType = queryNotification.EventType;
                        switch (eventType)
                        {
                        case QueryNotificationType.QueryResultChanged:
                            ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: EventType {0}. Calling ProcessQueryResultChangedNotification. user {1} SubscriptionId: {2}", eventType, base.UserContext.PrimarySmtpAddress, base.SubscriptionId);
                            this.ProcessQueryResultChangedNotification();
                            goto IL_1EE;

                        case QueryNotificationType.RowAdded:
                        case QueryNotificationType.RowDeleted:
                        case QueryNotificationType.RowModified:
                            ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: EventType {0} for user {1} SubscriptionId: {2}", eventType, base.UserContext.PrimarySmtpAddress, base.SubscriptionId);
                            this.notifier.AddFolderContentChangePayload(this.folderId, this.GetPayloadFromNotification(this.folderId, queryNotification));
                            goto IL_1EE;

                        case QueryNotificationType.Reload:
                            ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: EventType {0}. Calling ProcessReloadNotification. user {1} SubscriptionId: {2}", eventType, base.UserContext.PrimarySmtpAddress, base.SubscriptionId);
                            this.ProcessReloadNotification();
                            goto IL_1EE;
                        }
                        ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: EventType {0}. Ignoring. user {1} SubscriptionId: {2}", eventType, base.UserContext.PrimarySmtpAddress, base.SubscriptionId);
IL_1EE:
                        this.notifier.PickupData();
                    }
                }
            }
        }
Example #5
0
        private bool FProcessEventType(QueryNotificationType type)
        {
            bool result = false;

            switch (type)
            {
            case QueryNotificationType.RowAdded:
            case QueryNotificationType.RowDeleted:
            case QueryNotificationType.RowModified:
            case QueryNotificationType.Reload:
                result = true;
                break;
            }
            return(result);
        }
        // Token: 0x0600146E RID: 5230 RVA: 0x0007CC60 File Offset: 0x0007AE60
        private void AddRowProperties(TextWriter writer, QueryNotificationType notificationType)
        {
            Utilities.JavascriptEncode(this.ItemList.DataSource.GetItemProperty <bool>(MessageItemSchema.IsRead, true) ? "1" : "0", writer);
            writer.Write("','");
            string s = string.Empty;

            if (this.listView is GroupByList2)
            {
                s = ((GroupByList2)this.listView).GetItemGroupByValueString();
            }
            Utilities.JavascriptEncode(s, writer);
            if (notificationType == QueryNotificationType.RowModified && !this.isConversationView)
            {
                writer.Write("','");
                Utilities.JavascriptEncode(this.ItemList.DataSource.GetItemProperty <string>(ItemSchema.Subject, string.Empty), writer);
            }
        }
        // Token: 0x0600146C RID: 5228 RVA: 0x0007CB4C File Offset: 0x0007AD4C
        private void AddRowNotificationPrefix(TextWriter writer, QueryNotification notification)
        {
            writer.Write("folderChangeNotification('");
            Utilities.JavascriptEncode(this.contextFolderId.StoreObjectId.ToBase64String(), writer);
            writer.Write("',['");
            QueryNotificationType eventType = notification.EventType;

            switch (eventType)
            {
            case QueryNotificationType.RowAdded:
            case QueryNotificationType.RowDeleted:
            case QueryNotificationType.RowModified:
                writer.Write((int)eventType);
                writer.Write("','");
                Utilities.JavascriptEncode(Convert.ToBase64String(notification.Index), writer);
                writer.Write("'");
                return;

            default:
                throw new ArgumentException("invalid value for notificationType");
            }
        }
        // Token: 0x06001463 RID: 5219 RVA: 0x0007C7A0 File Offset: 0x0007A9A0
        internal void ProcessNotification(TextWriter writer, QueryNotification notification, out bool successfullyProcessed)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (notification == null)
            {
                throw new ArgumentNullException("notification");
            }
            successfullyProcessed = true;
            if (this.isDisposed || this.missedNotifications || this.needReinitSubscriptions)
            {
                string message = string.Format("Ignoring folder content change notification for user {0}, isDisposed:{1}, missedNotifications:{2}, needReinitSubscriptions:{3}", new object[]
                {
                    this.MailboxSessionDisplayName,
                    this.isDisposed,
                    this.missedNotifications,
                    this.needReinitSubscriptions
                });
                ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), message);
                return;
            }
            try
            {
                QueryNotificationType eventType = notification.EventType;
                Culture.InternalSetAsyncThreadCulture(this.userContext.UserCulture);
                switch (eventType)
                {
                case QueryNotificationType.RowAdded:
                    this.ProcessRowAddedNotification(writer, notification);
                    break;

                case QueryNotificationType.RowDeleted:
                    this.ProcessRowDeletedNotification(writer, notification);
                    break;

                case QueryNotificationType.RowModified:
                    this.ProcessRowModifiedNotification(writer, notification);
                    break;

                default:
                    throw new ArgumentException("Invalid queryNotificationType :" + eventType);
                }
            }
            catch (Exception ex)
            {
                if (!this.isDisposed && !this.missedNotifications && !this.needReinitSubscriptions)
                {
                    ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "Unexpected exception in FolderContentChangeNotificationHandler:ProcessNotification. Exception: {0}", ex.Message);
                    if (Globals.SendWatsonReports)
                    {
                        ExTraceGlobals.CoreTracer.TraceDebug(0L, "Sending watson report");
                        ExWatson.AddExtraData(this.GetExtraWatsonData());
                        ExWatson.SendReport(ex, ReportOptions.None, null);
                    }
                    successfullyProcessed    = false;
                    this.missedNotifications = true;
                }
            }
        }