public void PollAndProcess() { ExTraceGlobals.OehCallTracer.TraceDebug((long)this.GetHashCode(), "NotificationEventHandler.PollAndProcess"); this.ProcessOwaConditionAdvisors(); this.ProcessOwaFolderCountAdvisor(); this.ProcessOwaLastEventAdvisor(); long num = Globals.ApplicationTime - base.UserContext.LastUserRequestTime; int num2 = 1; long num3 = (long)(base.UserContext.Configuration.NotificationInterval * 1000); if (num >= num3 * 16L) { if (num < num3 * 64L) { num2 = 3; } else { num2 = 5; } } long val = Math.Max(base.UserContext.Timeout - 60000L, 30000L); long num4 = Math.Min((long)num2 * num3, val); this.Writer.Write("setPllInt(" + num4 + "); "); if (num2 == 1) { long num5 = Globals.ApplicationTime - base.UserContext.LastQuotaUpdateTime; if ((base.UserContext.IsQuotaAboveWarning && num5 >= 900000L) || num5 >= 1800000L) { this.Writer.Write("updateMailboxUsage(\""); using (StringWriter stringWriter = new StringWriter()) { RenderingUtilities.RenderMailboxQuota(stringWriter, base.UserContext); Utilities.JavascriptEncode(stringWriter.ToString(), this.Writer); } this.Writer.Write("\"); "); } } }
public void GetMailboxUsage() { RenderingUtilities.RenderMailboxQuota(this.Writer, base.UserContext); }
internal void HandlePendingGetTimerCallback(bool clearSearchFolderDeleteList) { string mailboxQuotaHtml = null; bool flag = false; bool flag2 = false; bool flag3 = false; try { this.userContext.Lock(); OwaMapiNotificationHandler.UpdateMailboxSessionBeforeAccessing(this.mailboxSession, this.userContext); lock (this) { if (this.isDisposed) { return; } flag3 = this.InitSubscriptions(ClientSubscriptionFlags.None); if (this.missedNotifications) { flag3 = true; } if (clearSearchFolderDeleteList) { this.ClearSearchFolderDeleteList(); } if (this.searchFolderIdCurrent == null) { this.ResetSearchFolderReferences(true); } this.missedNotifications = false; } long num = Globals.ApplicationTime - this.userContext.LastQuotaUpdateTime; if ((this.userContext.IsQuotaAboveWarning && num >= 900000L) || num >= 1800000L) { using (StringWriter stringWriter = new StringWriter()) { RenderingUtilities.RenderMailboxQuota(stringWriter, this.userContext); mailboxQuotaHtml = stringWriter.ToString(); } flag = true; } int num2 = (int)DateTimeUtilities.GetLocalTime(this.userContext).Bias.TotalMinutes; if (num2 != this.userContext.RemindersTimeZoneOffset) { this.userContext.RemindersTimeZoneOffset = num2; flag2 = true; } if (this.userContext.LockedByCurrentThread()) { Utilities.DisconnectStoreSession(this.mailboxSession); this.userContext.Unlock(); } if (flag3) { this.emailPayload.AddRefreshPayload(); } else { if (flag) { this.emailPayload.AddQuotaPayload(mailboxQuotaHtml); } if (flag2) { this.emailPayload.AddReminderNotifyPayload(num2); } } this.emailPayload.PickupData(); } catch (OwaLockTimeoutException ex) { ExTraceGlobals.CoreCallTracer.TraceDebug <string>((long)this.GetHashCode(), "User context lock timed out in the pending GET timer callback. Exception: {0}", ex.Message); } catch (Exception ex2) { ExTraceGlobals.CoreCallTracer.TraceDebug <string>((long)this.GetHashCode(), "Unexpected exception in pending GET timer callback thread. Exception: {0}", ex2.Message); } finally { if (this.userContext.LockedByCurrentThread()) { Utilities.DisconnectStoreSessionSafe(this.mailboxSession); this.userContext.Unlock(); } } }