// Token: 0x0600146A RID: 5226 RVA: 0x00075DC0 File Offset: 0x00073FC0 public bool IsMailboxInteresting(MailboxInformation mailboxInformation) { InferenceDataCollectionAssistantType.tracer.TraceFunction((long)this.GetHashCode(), "InferenceDataCollectionAssistantType.IsMailboxInteresting"); if (InferenceCommonUtility.IsNonUserMailbox(mailboxInformation.DisplayName)) { this.diagnosticLogger.LogDebug("Skipping mailbox with guid {0} and display name {1} since it is identified as a non-user mailbox.", new object[] { mailboxInformation.MailboxGuid, mailboxInformation.DisplayName }); return(false); } if (this.collectionContext.Configuration.IsOutputSanitized) { if (!this.collectionContext.HashProvider.IsInitialized && !this.hashProviderInitializeAttemptedInWorkcycle) { try { bool flag = this.collectionContext.HashProvider.Initialize(); this.diagnosticLogger.LogDebug("Hash provider initialization success = {0}", new object[] { flag }); } catch (Exception ex) { this.diagnosticLogger.LogDebug("Hash provider initialization failed with exception {0}", new object[] { ex.ToString() }); } this.hashProviderInitializeAttemptedInWorkcycle = true; } if (!this.collectionContext.HashProvider.IsInitialized) { this.diagnosticLogger.LogDebug("Skipping mailbox with guid {0} and display name {1} as the hash provider is not initialized.", new object[] { mailboxInformation.MailboxGuid, mailboxInformation.DisplayName }); return(false); } } object mailboxProperty = mailboxInformation.GetMailboxProperty(MailboxSchema.InferenceDataCollectionProcessingState); if (mailboxProperty != null) { byte[] array = mailboxProperty as byte[]; ExDateTime t = new ExDateTime(ExTimeZone.UtcTimeZone, mailboxInformation.LastProcessedDate).Add(this.config.MailboxReprocessAge); if (array[0] == 1 && ExDateTime.UtcNow < t) { this.diagnosticLogger.LogDebug("Skipping mailbox with guid {0} and display name {1} since it reached {2} collection state on {3}", new object[] { mailboxInformation.MailboxGuid, mailboxInformation.DisplayName, (InferenceDataCollectionAssistantType.DataCollectionProcessingState)array[0], mailboxInformation.LastProcessedDate }); return(false); } } mailboxProperty = mailboxInformation.GetMailboxProperty(MailboxSchema.ItemCount); if (mailboxProperty != null && (int)mailboxProperty > this.config.MinimumItemCountInMailbox) { int num = InferenceDataCollectionAssistantType.IsGroupMailbox(mailboxInformation) ? this.config.ModuloNumberToRandomizeForGroups : this.config.ModuloNumberToRandomize; int num2 = this.randomizer.Next(1, int.MaxValue); bool flag2 = num2 % num == 0; this.diagnosticLogger.LogDebug("{0} mailbox with guid {1} and display name {2} based on random selection (random number = {3}, modulo arithmetic number = {4})", new object[] { flag2 ? "Picking" : "Skipping", mailboxInformation.MailboxGuid, mailboxInformation.DisplayName, num2, this.config.ModuloNumberToRandomize }); return(flag2); } this.diagnosticLogger.LogDebug("Skipping mailbox with guid {0} and display name {1} since ContentCount property value {2} is less than the required minimum {3}", new object[] { mailboxInformation.MailboxGuid, mailboxInformation.DisplayName, (mailboxProperty != null) ? ((int)mailboxProperty) : -1, this.config.MinimumItemCountInMailbox }); return(false); }
public void Render(TextWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } SchedulingAreaVisualContainer schedulingAreaVisualContainer = base.ViewDays[0]; this.totalNumberOfColumns = this.GetTotalNumberOfColumns(schedulingAreaVisualContainer, this.conflictsPerTimeSlot); this.CalculateStartAndEndTimes(); this.ComputeDayFreeBusy(); writer.Write("<table cellpadding=0 cellspacing=0 class=\"cdayvw\"><caption>"); writer.Write(LocalizedStrings.GetHtmlEncoded(573876176)); writer.Write("</caption>"); string text = DateTimeUtilities.GetDaysFormat(this.UserContext.UserOptions.DateFormat); if (text == null) { text = "%d"; } ExDateTime exDateTime = schedulingAreaVisualContainer.DateRange.Start.IncrementDays(-1); ExDateTime exDateTime2 = schedulingAreaVisualContainer.DateRange.Start.IncrementDays(1); writer.Write("<tr><td rowspan=2 class=\"nv\" align=\"center\"><a href=\"#\" title=\""); writer.Write(LocalizedStrings.GetHtmlEncoded(790373277)); writer.Write("\" onClick=\"return onClkD({0},{1},{2});\"><img src=\"", exDateTime.Year, exDateTime.Month, exDateTime.Day); this.UserContext.RenderThemeFileUrl(writer, ThemeFileId.PreviousPage); writer.Write("\" alt=\""); writer.Write(LocalizedStrings.GetHtmlEncoded(790373277)); writer.Write("\"></a><a href=\"#\" title=\""); writer.Write(LocalizedStrings.GetHtmlEncoded(-943287977)); writer.Write("\" onClick=\"return onClkD({0},{1},{2});\"><img src=\"", exDateTime2.Year, exDateTime2.Month, exDateTime2.Day); this.UserContext.RenderThemeFileUrl(writer, ThemeFileId.NextPage); writer.Write("\" alt=\""); writer.Write(LocalizedStrings.GetHtmlEncoded(-943287977)); writer.Write("\"></a></td><td colspan="); writer.Write(this.totalNumberOfColumns); writer.Write(" class=\"cvhd"); ExDateTime localTime = DateTimeUtilities.GetLocalTime(); if (schedulingAreaVisualContainer.DateRange.Start.Year == localTime.Year && schedulingAreaVisualContainer.DateRange.Start.Month == localTime.Month && schedulingAreaVisualContainer.DateRange.Start.Day == localTime.Day) { writer.Write(" cd"); } writer.Write("\" align=\"center\"><span>"); writer.Write(Utilities.HtmlEncode(schedulingAreaVisualContainer.DateRange.Start.ToString(text))); writer.Write("</span>"); writer.Write(Utilities.HtmlEncode(schedulingAreaVisualContainer.DateRange.Start.ToString("dddd"))); writer.Write("</td></tr>"); string freeBusyStylePrefix = DailyView.GetFreeBusyStylePrefix(this.dayBusyType); writer.Write("<tr><td colspan={0} class=\"{1}e\">", this.totalNumberOfColumns, freeBusyStylePrefix); if (base.EventArea.Count > 0) { this.RenderEventArea(writer); } else { writer.Write(" "); } writer.Write("</td></tr>"); this.RenderSchedulingArea(writer, schedulingAreaVisualContainer); writer.Write("</table>"); }
internal SuggestionDayResult(ExDateTime currentDate, int inputMeetingDuration, int requiredAttendeeCount, int optionalAttendeeCount, AttendeeData[] attendees, ConfigOptions options, ExDateTime currentMeetingTime) { this.date = currentDate.LocalTime; ExDateTime t = ExDateTime.Now.ToUtc(); List <Suggestion> list = new List <Suggestion>(); ExDateTime t2 = currentDate.AddDays(1.0); ExDateTime exDateTime = currentDate.ToUtc(); while (exDateTime < t2) { if (exDateTime >= t || exDateTime == currentMeetingTime) { list.Add(new Suggestion(currentDate.TimeZone.ConvertDateTime(exDateTime), inputMeetingDuration, requiredAttendeeCount, optionalAttendeeCount, attendees, options)); } exDateTime = exDateTime.AddMinutes((double)options.SuggestionInterval); } this.rawSuggestionsList = list.ToArray(); this.FilterSuggestions(list, options, currentMeetingTime); foreach (Suggestion suggestion in list) { if (suggestion.SuggestionQuality < this.quality) { this.quality = suggestion.SuggestionQuality; } } this.meetingSuggestions = list.ToArray(); }
private MethodCallLatencyStatisticsLogger.MethodCallLatencyStatisticsLogRow CollectMethodCallStatisticsLog(string methodName, ExDateTime startTime, TimeSpan latency) { return(new MethodCallLatencyStatisticsLogger.MethodCallLatencyStatisticsLogRow { RequestId = this.Parameters.RequestId, StartTime = startTime, Tag = this.Parameters.Tag, TenantGuid = new Guid?(this.Parameters.TenantGuid), UserObjectGuid = new Guid?(this.Parameters.UserObjectGuid), MethodName = methodName, Latency = latency }); }
private void RenderSchedulingArea(TextWriter writer, SchedulingAreaVisualContainer day) { int[,] array = this.MapSchedulingAreaData(day, this.totalNumberOfColumns); string text = DateTimeUtilities.GetHoursFormat(this.UserContext.UserOptions.TimeFormat); string arg = "00"; if (text == null) { text = "%h"; } int num = this.renderDayStartTime / 30; int num2 = this.renderDayEndTime / 30; int num3 = this.userDayStartTime / 30; int num4 = this.userDayEndTime / 30; ICalendarDataSource dataSource = base.CalendarAdapter.DataSource; ExDateTime exDateTime = new ExDateTime(this.UserContext.TimeZone, 2000, 1, 1, num / 2, 0, 0); for (int i = num; i < num2; i++) { writer.Write("<tr><td class=\""); if (i == num) { writer.Write("frst "); } if (i % 2 == 0) { if (text[1] == 'h') { if (exDateTime.Hour >= 0 && exDateTime.Hour < 12) { arg = Utilities.HtmlEncode(Culture.AMDesignator); } else if (exDateTime.Hour >= 12) { arg = Utilities.HtmlEncode(Culture.PMDesignator); } } writer.Write("tm\" align=\"right\">{0} <span>{1}</span>", exDateTime.ToString(text), arg); exDateTime = exDateTime.AddHours(1.0); } else { writer.Write("tme\"> "); } writer.Write("</td>"); for (int j = 0; j < this.totalNumberOfColumns; j++) { if (array[i, j] >= 0 && array[i, j] >= 0) { int num5 = j + 1; int num6 = 1; while (num5 < this.totalNumberOfColumns && array[i, num5] == array[i, j]) { array[i, num5] = -1; num5++; } int num7 = num5 - j; if (array[i, j] != 0) { num6 = 1; int num8 = i + 1; while (num8 < num2 && array[num8, j] == array[i, j]) { num6++; for (int k = 0; k < num7; k++) { array[num8, j + k] = -1; } num8++; } } string freeBusyStylePrefix = DailyView.GetFreeBusyStylePrefix(base.RowFreeBusy[0][i]); writer.Write("<td class=\""); if (array[i, j] == 0) { writer.Write(freeBusyStylePrefix); if (i % 2 == 0) { writer.Write("d "); } else { writer.Write("l "); } writer.Write(freeBusyStylePrefix); if (num3 <= num4 && i >= num3 && i < num4) { writer.Write("w"); } else if (num3 > num4 && (i >= num3 || i < num4)) { writer.Write("w"); } else { writer.Write("n"); } } else if (array[i, j] > 0) { writer.Write("v"); int index = array[i, j] - 1; ExDateTime startTime = dataSource.GetStartTime(index); ExDateTime endTime = dataSource.GetEndTime(index); if (startTime.Date < day.DateRange.Start.Date) { writer.Write(" ntp"); } else if (endTime.Date > day.DateRange.Start.Date) { writer.Write(" nbtm"); } } writer.Write("\""); if (num6 > 1) { writer.Write(" rowspan={0}", num6); } if (num7 > 1) { writer.Write(" colspan={0}", num7); } if (num7 < this.totalNumberOfColumns) { writer.Write(" width=\"{0:f}%\"", num7 * 100 / this.totalNumberOfColumns); } if (array[i, j] > 0) { writer.Write(" nowrap"); } writer.Write(">"); if (array[i, j] == 0) { writer.Write(" </td>"); } else if (array[i, j] > 0) { int index2 = array[i, j] - 1; ExDateTime startTime2 = dataSource.GetStartTime(index2); ExDateTime endTime2 = dataSource.GetEndTime(index2); string subject = dataSource.GetSubject(index2); string location = dataSource.GetLocation(index2); OwaStoreObjectId itemId = dataSource.GetItemId(index2); bool isPrivate = dataSource.IsPrivate(index2); CalendarItemTypeWrapper wrappedItemType = dataSource.GetWrappedItemType(index2); bool flag = dataSource.IsMeeting(index2); string text2 = string.Empty; if (flag) { text2 = dataSource.GetOrganizerDisplayName(index2); } bool hasAttachment = dataSource.HasAttachment(index2); int num9 = 64; int num10 = 3; this.ComputeMaxCharactersAndIcons(num6, num7, out num9, out num10); writer.Write("<table cellspacing=0 cellpadding=0 class=\"vis\"><tr>"); BusyTypeWrapper wrappedBusyType = dataSource.GetWrappedBusyType(index2); if (wrappedBusyType != BusyTypeWrapper.Busy) { writer.Write("<td class=\""); switch (wrappedBusyType) { case BusyTypeWrapper.Free: writer.Write("f\"><img src=\""); this.UserContext.RenderThemeFileUrl(writer, ThemeFileId.Clear); writer.Write("\" alt=\"\"></td>"); break; case BusyTypeWrapper.Tentative: writer.Write("t\"></td>"); break; case BusyTypeWrapper.OOF: writer.Write("o\"></td>"); break; case BusyTypeWrapper.Unknown: writer.Write("u\"></td>"); break; } } writer.Write("<td class=\"txt\">"); switch (num6) { case 1: this.RenderSubject(writer, subject, num9, startTime2, endTime2, location, false, flag, itemId); if (!string.IsNullOrEmpty(subject)) { num9 -= subject.Length; } else if (flag) { num9 -= LocalizedStrings.GetNonEncoded(-1500721828).Length; } else { num9 -= LocalizedStrings.GetNonEncoded(-1178892512).Length; } if (!string.IsNullOrEmpty(location) && (location.Length + 2 <= num9 || num9 >= 5)) { writer.Write("; "); Utilities.CropAndRenderText(writer, location, num9 - 2); } break; case 2: this.RenderSubject(writer, subject, num9, startTime2, endTime2, location, false, flag, itemId); if (!string.IsNullOrEmpty(location)) { writer.Write("<br>"); Utilities.CropAndRenderText(writer, location, num9); num9 -= location.Length; } if (!string.IsNullOrEmpty(text2) && flag && num9 > 3) { writer.Write("; "); Utilities.CropAndRenderText(writer, text2, num9); } break; default: this.RenderSubject(writer, subject, num9, startTime2, endTime2, location, false, flag, itemId); if (!string.IsNullOrEmpty(location)) { writer.Write("<br>"); Utilities.CropAndRenderText(writer, location, num9); } if (!string.IsNullOrEmpty(text2) && flag) { writer.Write("<br>"); Utilities.CropAndRenderText(writer, text2, num9); } break; } writer.Write("</td>"); if (num10 > 0) { writer.Write("<td class=\"icn\" align=\"right\">"); this.RenderIcons(writer, num10, isPrivate, wrappedItemType, hasAttachment); writer.Write("</td>"); } writer.Write("</tr></table></td>"); } } } writer.Write("</tr>"); } int num11 = base.RowFreeBusy[0].Length - 1; string freeBusyStylePrefix2 = DailyView.GetFreeBusyStylePrefix(base.RowFreeBusy[0][num11]); writer.Write("<tr><td class=\"tm\"><img src=\""); this.UserContext.RenderThemeFileUrl(writer, ThemeFileId.Clear); writer.Write("\" alt=\"\"></td><td colspan=\"{0}\" class=\"{1}d {1}n\"><img src=\"", this.totalNumberOfColumns, freeBusyStylePrefix2); this.UserContext.RenderThemeFileUrl(writer, ThemeFileId.Clear); writer.Write("\" alt=\"\"></td></tr>"); writer.Write("<tr><td class=\"tme h100\"><img src=\""); this.UserContext.RenderThemeFileUrl(writer, ThemeFileId.Clear); writer.Write("\" alt=\"\"></td><td colspan=\"{0}\" class=\"{1}n\"></td></tr>", this.totalNumberOfColumns, freeBusyStylePrefix2); }
// Token: 0x060002F7 RID: 759 RVA: 0x0001A708 File Offset: 0x00018908 private void RenderDevices() { DeviceInfo[] allDeviceInfo = DeviceInfo.GetAllDeviceInfo(this.userContext.MailboxSession, MobileClientType.EAS | MobileClientType.MOWA); if (allDeviceInfo != null) { Array.Sort(allDeviceInfo, new MobileOptions.SortByLastSyncTime()); string weekdayDateTimeFormat = this.userContext.UserOptions.GetWeekdayDateTimeFormat(false); for (int i = allDeviceInfo.Length - 1; i >= 0; i--) { DeviceInfo deviceInfo = allDeviceInfo[i]; string value = i.ToString(); this.writer.Write("<tr class=\"data\"><td class=\"l\">"); this.writer.Write("<input name=\"device\" type=\"radio\" value=\""); this.writer.Write(value); this.writer.Write("\" onclick=\"onClkMd(this)\">"); this.writer.Write("<input type=\"hidden\" id=\"ptl"); this.writer.Write(value); this.writer.Write("\" value=\""); Utilities.HtmlEncode(deviceInfo.DeviceIdentity.Protocol, this.writer); this.writer.Write("\"><input type=\"hidden\" id=\"dtp"); this.writer.Write(value); this.writer.Write("\" value=\""); Utilities.HtmlEncode(deviceInfo.DeviceIdentity.DeviceType, this.writer); this.writer.Write("\"><input type=\"hidden\" id=\"did"); this.writer.Write(value); this.writer.Write("\" value=\""); Utilities.HtmlEncode(deviceInfo.DeviceIdentity.DeviceId, this.writer); this.writer.Write("\"><input type=\"hidden\" id=\"wpSts"); this.writer.Write(value); this.writer.Write("\" value=\""); this.writer.Write(this.GetWipeStatus(deviceInfo)); this.writer.Write("\"><input type=\"hidden\" id=\"wpSpt"); this.writer.Write(value); this.writer.Write("\" value=\""); this.writer.Write(deviceInfo.IsRemoteWipeSupported ? "1" : "0"); this.writer.Write("\"></td><td>"); Utilities.HtmlEncode(deviceInfo.DeviceIdentity.DeviceType, this.writer); this.writer.Write("</td><td class=\"m\">"); if (deviceInfo.LastSyncAttemptTime != null) { Utilities.HtmlEncode(this.userContext.TimeZone.ConvertDateTime(deviceInfo.LastSyncAttemptTime.Value).ToString(weekdayDateTimeFormat), this.writer); } this.writer.Write("</td><td class=\"r\">"); if (deviceInfo.WipeAckTime != null) { this.writer.Write("<font color=\"green\">"); this.writer.Write(LocalizedStrings.GetHtmlEncoded(-1509940370)); this.writer.Write("</font>"); this.writer.Write(LocalizedStrings.GetHtmlEncoded(1484375142)); this.writer.Write("<br> <font color=\"red\"> <b>"); this.writer.Write(LocalizedStrings.GetHtmlEncoded(-1104574967)); this.writer.Write(" </b>"); this.writer.Write(LocalizedStrings.GetHtmlEncoded(-827928519)); this.writer.Write("</font>"); } else { if (deviceInfo.WipeRequestTime != null || deviceInfo.WipeSentTime != null) { this.writer.Write("<font color=\"red\">"); this.writer.Write(deviceInfo.IsRemoteWipeSupported ? LocalizedStrings.GetHtmlEncoded(-737505483) : LocalizedStrings.GetHtmlEncoded(-306081826)); this.writer.Write("</font> "); this.writer.Write(LocalizedStrings.GetHtmlEncoded((deviceInfo.WipeSentTime != null) ? -1560055325 : 1150686522)); this.writer.Write(" "); ExDateTime exDateTime = (deviceInfo.WipeSentTime != null) ? deviceInfo.WipeSentTime.Value : deviceInfo.WipeRequestTime.Value; this.writer.Write(exDateTime.ToString(weekdayDateTimeFormat)); if (deviceInfo.IsRemoteWipeSupported) { this.writer.Write("<br><b>"); this.writer.Write(LocalizedStrings.GetHtmlEncoded(-1104574967)); this.writer.Write(" </b>"); this.writer.Write(LocalizedStrings.GetHtmlEncoded(1704998644)); } } else { this.writer.Write(LocalizedStrings.GetHtmlEncoded(2041362128)); } if (deviceInfo.FirstSyncTime != null) { ExDateTime exDateTime2 = this.userContext.TimeZone.ConvertDateTime(deviceInfo.FirstSyncTime.Value); this.writer.Write("<br><br>"); this.writer.Write(LocalizedStrings.GetHtmlEncoded(-1006820371)); this.writer.Write(" "); this.writer.Write(exDateTime2.ToString(weekdayDateTimeFormat)); } MobileOptions.RenderDeviceStatusColon(-433064091, deviceInfo.DeviceFriendlyName, this.writer); MobileOptions.RenderDeviceStatusColon(-1924890268, deviceInfo.DeviceIdentity.DeviceId, this.writer); MobileOptions.RenderDeviceStatusColon(-538137132, deviceInfo.DeviceModel, this.writer); MobileOptions.RenderDeviceStatusColon(1804230700, deviceInfo.DevicePhoneNumber, this.writer); MobileOptions.RenderDeviceStatusColon(-2089297643, deviceInfo.DeviceOS, this.writer); MobileOptions.RenderDeviceStatusColon(-1969259845, deviceInfo.DeviceOSLanguage, this.writer); MobileOptions.RenderDeviceStatusColon(-390457951, deviceInfo.DeviceImei, this.writer); MobileOptions.RenderDeviceStatusColon(1030256077, deviceInfo.UserAgent, this.writer); } this.writer.Write("</td></tr>"); } } }
public static UpdateRumInfo CreateOccurrenceInstance(ExDateTime originalStartTime, IList <Attendee> attendees, CalendarInconsistencyFlag inconsistencyFlag) { return(new UpdateRumInfo(new ExDateTime?(originalStartTime), attendees, inconsistencyFlag)); }
public bool IsDateInRange(ExDateTime date) { return(date >= this.Start && date < this.End); }
private static void SyncInternal(MailboxSession mailboxSession, ExDateTime lastSyncTime, StoreId folderId, string folderDisplayname, SecurityAccessToken securityAccessToken) { RefreshSharingFolderClient.Tracer.TraceDebug <string, IExchangePrincipal>(0L, "Sync sharing folder {0} from mailbox {1}", folderDisplayname, mailboxSession.MailboxOwner); if (!RefreshSharingFolderClient.CanSyncNow(lastSyncTime)) { return; } NetworkServiceImpersonator.Initialize(); if (NetworkServiceImpersonator.Exception != null) { RefreshSharingFolderClient.Tracer.TraceError <LocalizedException>(0L, "Unable to impersonate network service to call EWS due exception {0}", NetworkServiceImpersonator.Exception); return; } string id = StoreId.StoreIdToEwsId(mailboxSession.MailboxOwner.MailboxInfo.MailboxGuid, folderId); IList <WebServicesService> list; try { ClientAccessType clientAccessType = RefreshSharingFolderClient.ClientAccessType; RefreshSharingFolderClient.Tracer.TraceDebug <ClientAccessType>(0L, "Will try to discover the URL for EWS with the following client access type: {0}", clientAccessType); ServiceTopology currentServiceTopology = ServiceTopology.GetCurrentServiceTopology("f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\Sharing\\RefreshSharingFolderClient.cs", "SyncInternal", 153); list = currentServiceTopology.FindAll <WebServicesService>(mailboxSession.MailboxOwner, clientAccessType, "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\Sharing\\RefreshSharingFolderClient.cs", "SyncInternal", 154); } catch (LocalizedException arg) { RefreshSharingFolderClient.Tracer.TraceError <IExchangePrincipal, LocalizedException>(0L, "Unable to discover internal URL for EWS for mailbox {0} due exception {1}", mailboxSession.MailboxOwner, arg); return; } if (list.Count != 0) { string text = list[0].Url.ToString(); RefreshSharingFolderClient.Tracer.TraceDebug <string>(0L, "Using {0} to call BeginRefreshSharingFolder", text); ExchangeServiceBinding exchangeServiceBinding = new ExchangeServiceBinding("RefreshSharingFolder", new RemoteCertificateValidationCallback(RefreshSharingFolderClient.CertificateErrorHandler)); exchangeServiceBinding.Url = text; exchangeServiceBinding.RequestServerVersionValue = new RequestServerVersion(); exchangeServiceBinding.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2010; exchangeServiceBinding.UserAgent = WellKnownUserAgent.GetEwsNegoAuthUserAgent("RefreshSharingFolder"); exchangeServiceBinding.Authenticator = SoapHttpClientAuthenticator.CreateNetworkService(); exchangeServiceBinding.Authenticator.AdditionalSoapHeaders.Add(new SerializedSecurityContextType { UserSid = securityAccessToken.UserSid, GroupSids = RefreshSharingFolderClient.SidStringAndAttributesConverter(securityAccessToken.GroupSids), RestrictedGroupSids = RefreshSharingFolderClient.SidStringAndAttributesConverter(securityAccessToken.RestrictedGroupSids), PrimarySmtpAddress = mailboxSession.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString() }); Exception ex = null; try { exchangeServiceBinding.BeginRefreshSharingFolder(new RefreshSharingFolderType { SharingFolderId = new FolderIdType { Id = id } }, new AsyncCallback(RefreshSharingFolderClient.TraceResponse), exchangeServiceBinding); } catch (SoapException ex2) { ex = ex2; } catch (WebException ex3) { ex = ex3; } catch (IOException ex4) { ex = ex4; } catch (InvalidOperationException ex5) { ex = ex5; } catch (LocalizedException ex6) { ex = ex6; } if (ex != null) { RefreshSharingFolderClient.Tracer.TraceError <StoreId, IExchangePrincipal, Exception>(0L, "Unable to sync sharing folder {0} in mailbox {1}. Exception {2}", folderId, mailboxSession.MailboxOwner, ex); } return; } RefreshSharingFolderClient.Tracer.TraceError <IExchangePrincipal>(0L, "Unable to find internal URL for EWS for mailbox {0}", mailboxSession.MailboxOwner); }
public bool Intersects(ExDateTime start, ExDateTime end) { return((start < this.End && end > this.Start) || (start == end && start < this.End && end >= this.Start)); }
public bool Includes(ExDateTime start, ExDateTime end) { return(start >= this.Start && end <= this.End); }
private void ProcessRecipients(IList <IMessageRecipient> recipients, IDictionary <string, IInferenceRecipient> contactList, ExDateTime sentTime, bool isReply, long currentTimeWindowNumber) { foreach (IMessageRecipient recipient in recipients) { IInferenceRecipient inferenceRecipient = new InferenceRecipient(recipient); string key = inferenceRecipient.SmtpAddress.ToLower(CultureInfo.InvariantCulture); if (!contactList.ContainsKey(key)) { contactList.Add(key, inferenceRecipient); } else { contactList[key].UpdateFromRecipient(inferenceRecipient); inferenceRecipient = contactList[key]; } if (inferenceRecipient.TotalSentCount == 0L) { int num = isReply ? 2 : 6; inferenceRecipient.FirstSentTime = sentTime.UniversalTime; inferenceRecipient.RawRecipientWeight = (double)(num - 1); inferenceRecipient.RecipientRank = int.MaxValue; } inferenceRecipient.TotalSentCount += 1L; inferenceRecipient.LastSentTime = sentTime.UniversalTime; inferenceRecipient.LastUsedInTimeWindow = currentTimeWindowNumber; inferenceRecipient.RawRecipientWeight += 1.0; } }
public LocalCalendarGroupEntryInfo(string calendarName, VersionedId id, LegacyCalendarColor color, StoreObjectId calendarId, byte[] calendarOrdinal, Guid parentGroupId, bool isICal, ExDateTime lastModifiedTime) : base(calendarName, id, color, calendarId, parentGroupId, calendarOrdinal, lastModifiedTime) { this.IsInternetCalendar = isICal; }
public int Compare(CalendarVisual visual1, CalendarVisual visual2) { if (object.ReferenceEquals(visual1, visual2)) { return(0); } if (visual1.Rect.X == visual2.Rect.X) { TimeSpan t = this.Duration(visual1); TimeSpan t2 = this.Duration(visual2); ExDateTime exDateTime = this.StartTime(visual1); ExDateTime exDateTime2 = this.StartTime(visual2); int num = this.FreeBusyStatus(visual1); int num2 = this.FreeBusyStatus(visual2); if (t.Days >= 1 || t2.Days >= 1) { if (t != t2) { if (!(t > t2)) { return(1); } return(-1); } else if (num != num2) { if (num <= num2) { return(1); } return(-1); } else if (exDateTime != exDateTime2) { return(ExDateTime.Compare(exDateTime, exDateTime2)); } } else { if (exDateTime != exDateTime2) { return(ExDateTime.Compare(exDateTime, exDateTime2)); } if (num != num2) { if (num <= num2) { return(1); } return(-1); } else if (t != t2) { if (!(t > t2)) { return(1); } return(-1); } } string subject = this.dataSource.GetSubject(visual1.DataIndex); string subject2 = this.dataSource.GetSubject(visual2.DataIndex); return(string.Compare(subject, subject2, StringComparison.CurrentCulture)); } if (visual1.Rect.X <= visual2.Rect.X) { return(-1); } return(1); }
protected Result(AnalysisMember source, Result parent, Exception exception, ExDateTime startTime, ExDateTime stopTime) { this.source = source; this.parent = parent; this.exception = exception; this.startTime = startTime; this.stopTime = stopTime; }
// Token: 0x06001849 RID: 6217 RVA: 0x0008E21C File Offset: 0x0008C41C private void ProcessGet(XmlNode verbNode) { using (this.user.Context.Tracker.Start(TimeId.TimeZoneOffsetSettingsGet)) { AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "Processing TimeZoneOffsetSettings - Get"); XmlNode xmlNode = null; try { XmlElement xmlElement = verbNode["StartTime"]; ExDateTime startTime; if (xmlElement == null || !ExDateTime.TryParseExact(xmlElement.InnerText, "yyyy-MM-dd\\THH:mm:ss.fff\\Z", null, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out startTime)) { this.status = StatusCode.InvalidStartTime; base.ProtocolLogger.SetValueIfNotSet(ProtocolLoggerData.Error, "InvalidStartTime"); return; } XmlElement xmlElement2 = verbNode["EndTime"]; ExDateTime endTime; if (xmlElement2 == null || !ExDateTime.TryParseExact(xmlElement2.InnerText, "yyyy-MM-dd\\THH:mm:ss.fff\\Z", null, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out endTime)) { this.status = StatusCode.InvalidEndTime; base.ProtocolLogger.SetValueIfNotSet(ProtocolLoggerData.Error, "InvalidEndTime"); return; } XmlNode xmlNode2 = base.Response.OwnerDocument.CreateElement("TimeZoneOffsets", "Settings:"); TimeZoneOffset[] array = null; try { array = TimeZoneOffsets.GetTheTimeZoneOffsets(startTime, endTime, null, null); } catch (ArgumentException arg) { AirSyncDiagnostics.TraceError <ArgumentException>(ExTraceGlobals.RequestsTracer, this, "TimeZoneOffsets.GetTheTimeZoneOffsets has thrown {0}", arg); this.status = StatusCode.InvalidTimezoneRange; base.ProtocolLogger.SetValueIfNotSet(ProtocolLoggerData.Error, "InvalidTimezoneRange"); return; } if (array != null) { foreach (TimeZoneOffset timeZoneOffset in array) { XmlNode xmlNode3 = base.Response.OwnerDocument.CreateElement("TimeZoneOffset", "Settings:"); XmlNode xmlNode4 = base.Response.OwnerDocument.CreateElement("TimeZoneID", "Settings:"); xmlNode4.InnerText = timeZoneOffset.TimeZoneId; xmlNode3.AppendChild(xmlNode4); XmlNode xmlNode5 = base.Response.OwnerDocument.CreateElement("TimeZoneRanges", "Settings:"); foreach (TimeZoneRange timeZoneRange in timeZoneOffset.OffsetRanges) { XmlNode xmlNode6 = base.Response.OwnerDocument.CreateElement("TimeZoneRange", "Settings:"); XmlNode xmlNode7 = base.Response.OwnerDocument.CreateElement("UtcTime", "Settings:"); xmlNode7.InnerText = timeZoneRange.UtcTime.ToString("yyyy-MM-dd\\THH:mm:ss.fff\\Z"); xmlNode6.AppendChild(xmlNode7); XmlNode xmlNode8 = base.Response.OwnerDocument.CreateElement("Offset", "Settings:"); xmlNode8.InnerText = timeZoneRange.Offset.ToString(); xmlNode6.AppendChild(xmlNode8); xmlNode5.AppendChild(xmlNode6); } xmlNode3.AppendChild(xmlNode5); xmlNode2.AppendChild(xmlNode3); } } xmlNode = base.Response.OwnerDocument.CreateElement("Get", "Settings:"); xmlNode.AppendChild(xmlNode2); } finally { XmlNode xmlNode9 = base.Response.OwnerDocument.CreateElement("Status", "Settings:"); XmlNode xmlNode10 = xmlNode9; int num = (int)this.status; xmlNode10.InnerText = num.ToString(CultureInfo.InvariantCulture); base.Response.AppendChild(xmlNode9); if (xmlNode != null) { base.Response.AppendChild(xmlNode); } } AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "Done processing TimeZoneOffsetSettings - Get."); } }
// Token: 0x06000017 RID: 23 RVA: 0x000025B4 File Offset: 0x000007B4 internal void DoScheduledWork(ITopologyConfigurationSession session) { if (this.StopEvent.WaitOne(0, false)) { return; } this.Context.Logger.Log(MigrationEventType.Information, "Starting Authentication Configuration task", new object[0]); AuthConfig authConfig = null; ADOperationResult adoperationResult = ADNotificationAdapter.TryRunADOperation(delegate() { authConfig = AuthConfig.Read(session); }); if (adoperationResult != ADOperationResult.Success) { this.Context.Logger.Log(MigrationEventType.Warning, "Unable to read Auth Config, result = {0}", new object[] { adoperationResult.ErrorCode.ToString() }); if (adoperationResult.Exception is TransientException) { throw adoperationResult.Exception; } return; } else { if (authConfig == null) { throw new InvalidAuthConfigurationException(DirectoryStrings.ErrorInvalidAuthSettings(string.Empty)); } if (authConfig.NextCertificateEffectiveDate == null || authConfig.NextCertificateEffectiveDate == null) { this.Context.Logger.Log(MigrationEventType.Information, "Next effective date is not set. Task complete", new object[0]); return; } ExDateTime exDateTime = (ExDateTime)authConfig.NextCertificateEffectiveDate.Value; if (exDateTime.ToUtc() > ExDateTime.UtcNow) { this.Context.Logger.Log(MigrationEventType.Information, "Next effective date has not yet occurred: {0}. Task complete", new object[] { exDateTime.ToUtc().ToString() }); return; } this.Context.Logger.Log(MigrationEventType.Information, "Next effective date {0} has occured, performing automatic certificate publish", new object[] { exDateTime.ToUtc().ToString() }); if (string.IsNullOrEmpty(authConfig.NextCertificateThumbprint) || string.Compare(authConfig.NextCertificateThumbprint, authConfig.CurrentCertificateThumbprint, StringComparison.OrdinalIgnoreCase) == 0) { this.Context.Logger.Log(MigrationEventType.Warning, "Next effective certificate thumbprint not set or same as current thumbprint, ignoring", new object[0]); authConfig.NextCertificateThumbprint = null; authConfig.NextCertificateEffectiveDate = null; } else { authConfig.PreviousCertificateThumbprint = authConfig.CurrentCertificateThumbprint; authConfig.CurrentCertificateThumbprint = authConfig.NextCertificateThumbprint; authConfig.NextCertificateThumbprint = null; authConfig.NextCertificateEffectiveDate = null; } session.Save(authConfig); this.Context.Logger.LogTerseEvent(MigrationEventType.Information, MSExchangeAuthAdminEventLogConstants.Tuple_CurrentSigningUpdated, new string[] { authConfig.CurrentCertificateThumbprint }); return; } }
protected override void InternalValidate() { if (this.StartDate == null && this.EndDate == null) { this.EndDate = new ExDateTime?(ExDateTime.Now); this.StartDate = new ExDateTime?(this.EndDate.Value.AddDays(-15.0)); } if (this.StartDate != null && this.EndDate == null) { this.EndDate = new ExDateTime?(this.StartDate.Value.AddDays(15.0)); } if (this.StartDate == null && this.EndDate != null) { this.StartDate = new ExDateTime?(this.EndDate.Value.AddDays(-15.0)); } if (this.StartDate.Value > this.EndDate.Value) { base.WriteError(new ArgumentException(Strings.AdminAuditLogSearchStartDateIsLaterThanEndDate(this.StartDate.Value.ToString(), this.EndDate.Value.ToString())), ErrorCategory.InvalidArgument, null); } if (base.Fields["ResultSize"] == null) { this.ResultSize = 1000; } int num = 250000; if (base.Fields["StartIndex"] == null) { this.StartIndex = 0; } if (this.StartIndex < 0 || this.StartIndex > num) { base.WriteError(new ArgumentOutOfRangeException("StartIndex", this.StartIndex, Strings.AdminAuditLogSearchOutOfRangeStartIndex(num)), ErrorCategory.InvalidArgument, null); } this.searchObject = new AdminAuditLogSearch { OrganizationId = base.CurrentOrganizationId, Cmdlets = this.Cmdlets, Parameters = this.Parameters, ObjectIds = this.ObjectIds, UserIdsUserInput = this.UserIds, Succeeded = this.IsSuccess, StartIndex = this.StartIndex, ExternalAccess = this.ExternalAccess, ResultSize = this.ResultSize, RedactDatacenterAdmins = !AdminAuditExternalAccessDeterminer.IsExternalAccess(base.SessionSettings.ExecutingUserIdentityName, base.SessionSettings.ExecutingUserOrganizationId, base.SessionSettings.CurrentOrganizationId) }; if (!this.StartDate.Value.HasTimeZone) { ExDateTime exDateTime = ExDateTime.Create(ExTimeZone.CurrentTimeZone, this.StartDate.Value.UniversalTime)[0]; this.searchObject.StartDateUtc = new DateTime?(exDateTime.UniversalTime); } else { this.searchObject.StartDateUtc = new DateTime?(this.StartDate.Value.UniversalTime); } if (!this.EndDate.Value.HasTimeZone) { ExDateTime exDateTime2 = ExDateTime.Create(ExTimeZone.CurrentTimeZone, this.EndDate.Value.UniversalTime)[0]; this.searchObject.EndDateUtc = new DateTime?(exDateTime2.UniversalTime); } else { this.searchObject.EndDateUtc = new DateTime?(this.EndDate.Value.UniversalTime); } AdminAuditLogHelper.SetResolveUsers(this.searchObject, new DataAccessHelper.GetDataObjectDelegate(base.GetDataObject <ADRecipient>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning)); this.searchObject.Validate(new Task.TaskErrorLoggingDelegate(base.WriteError)); base.InternalValidate(); }
internal static CalendarEvent[] GetCalendarEvents(EmailAddress emailAddress, CalendarFolder calendarFolder, ExDateTime windowStart, ExDateTime windowEnd, FreeBusyViewType accessAllowed, bool canActAsMailboxOwner, ExchangeVersionType exchangeVersion) { CalendarEvent[] array = null; int num = 0; object[][] calendarView = calendarFolder.GetCalendarView(windowStart, windowEnd, InternalCalendarQuery.CalendarQueryProperties); InternalCalendarQuery.CalendarViewTracer.TraceDebug(0L, "{0}: Query for {1} found {2} appointment entries between {3} and {4}", new object[] { TraceContext.Get(), emailAddress, calendarView.Length, windowStart, windowEnd }); num += calendarView.Length; if (num > Configuration.MaximumResultSetSize) { LocalizedException ex = new ResultSetTooBigException(Configuration.MaximumResultSetSize, num); InternalCalendarQuery.CalendarViewTracer.TraceError <object, EmailAddress, LocalizedException>(0L, "{0}: Query for {1} got exception getting Calendar Data. Exception: {2}", TraceContext.Get(), emailAddress, ex); throw ex; } int length = calendarView.GetLength(0); if (length > 0) { array = new CalendarEvent[length]; for (int i = 0; i < length; i++) { object[] properties = calendarView[i]; array[i] = CalendarEvent.CreateFromQueryData(emailAddress, properties, accessAllowed, canActAsMailboxOwner, exchangeVersion); } } return(array); }
public static CancellationRumInfo CreateOccurrenceInstance(ExDateTime originalStartTime, IList <Attendee> attendees) { return(new CancellationRumInfo(new ExDateTime?(originalStartTime), attendees)); }
protected void CollectAndLogMethodCallStatisticInformation(string methodName, ExDateTime startTime, TimeSpan latency) { ExTraceGlobals.SpeechRecognitionTracer.TraceDebug <string, string, string>((long)this.GetHashCode(), "CollectAndLogMethodCallStatisticInformation with methodName='{0}', startTime:'{1}', latency:'{2}'", methodName, startTime.ToString(), latency.TotalSeconds.ToString()); MethodCallLatencyStatisticsLogger.MethodCallLatencyStatisticsLogRow row = this.CollectMethodCallStatisticsLog(methodName, startTime, latency); SpeechRecognitionHandler.MethodCallLatencyStatisticsLogger.Append(row); }
internal void Flush() { if (AmSystemManager.Instance.Config.IsPAM) { Dictionary <AmServerName, AmCachedLastLogUpdater.ServerRequestInfo> dictionary = this.Cleanup(); if (dictionary.Count > 0) { Exception ex = null; try { using (IClusterDB clusterDB = ClusterDB.Open()) { if (clusterDB.IsInitialized) { using (IClusterDBWriteBatch clusterDBWriteBatch = clusterDB.CreateWriteBatch("ExchangeActiveManager\\LastLog")) { this.PopulateBatch(clusterDBWriteBatch, dictionary); clusterDBWriteBatch.Execute(); ExDateTime now = ExDateTime.Now; foreach (AmServerName key in dictionary.Keys) { this.serverUpdateTimeMap[key] = now; } goto IL_BA; } } ExTraceGlobals.ClusterTracer.TraceError((long)this.GetHashCode(), "Flush(): clusdb is not initialized"); IL_BA :; } } catch (ADExternalException ex2) { ex = ex2; } catch (ADOperationException ex3) { ex = ex3; } catch (ADTransientException ex4) { ex = ex4; } catch (ClusterException ex5) { ex = ex5; } catch (AmServerException ex6) { ex = ex6; } catch (AmServerTransientException ex7) { ex = ex7; } if (ex != null) { ReplayCrimsonEvents.CachedLastLogUpdateFailed.LogPeriodic <int, string>(AmServerName.LocalComputerName.NetbiosName, TimeSpan.FromMinutes(5.0), dictionary.Count, ex.Message); } } } }
private void RenderEventArea(TextWriter writer) { DateTimeUtilities.GetDaysFormat(this.UserContext.UserOptions.DateFormat); writer.Write("<table cellspacing=0 cellpadding=0 id=\"evt\">"); int num = 0; while (num < base.EventArea.Count && num < this.MaxEventAreaRows) { EventAreaVisual eventAreaVisual = (EventAreaVisual)base.EventArea[num]; int dataIndex = eventAreaVisual.DataIndex; if (!base.IsItemRemoved(dataIndex)) { if (num > 0) { writer.Write("<tr><td colspan=3 class=\"hspc\"></td></tr>"); } ICalendarDataSource dataSource = base.CalendarAdapter.DataSource; string subject = dataSource.GetSubject(dataIndex); ExDateTime startTime = dataSource.GetStartTime(dataIndex); ExDateTime endTime = dataSource.GetEndTime(dataIndex); string location = dataSource.GetLocation(dataIndex); bool isMeeting = dataSource.IsMeeting(dataIndex); bool flag = dataSource.HasAttachment(dataIndex); string format = "{0} {1:" + CultureInfo.CurrentCulture.DateTimeFormat.MonthDayPattern + "}"; string altAndTitleText = string.Format(format, Strings.EventFrom, startTime); string altAndTitleText2 = string.Format(format, Strings.EventTo, endTime); OwaStoreObjectId itemId = dataSource.GetItemId(dataIndex); bool flag2 = dataSource.IsPrivate(dataIndex); CalendarItemTypeWrapper wrappedItemType = dataSource.GetWrappedItemType(dataIndex); writer.Write("<tr>"); int num2 = 0; if (eventAreaVisual.LeftBreak) { num2 |= 1; } if (eventAreaVisual.RightBreak) { num2 |= 2; } switch (num2) { case 0: writer.Write("<td class=\"spc\"></td><td class=\"lt rt\" align=\"center\">"); this.RenderSubject(writer, subject, 64, startTime, endTime, location, true, isMeeting, itemId); if (flag2 || wrappedItemType != CalendarItemTypeWrapper.Single || flag) { this.RenderIcons(writer, 3, flag2, wrappedItemType, flag); } writer.Write("</td><td class=\"spc\"></td>"); break; case 1: this.RenderPreviousDayImage(writer, altAndTitleText); writer.Write("<td class=\"rt\" align=\"center\">"); this.RenderSubject(writer, subject, 64, startTime, endTime, location, true, isMeeting, itemId); if (flag2 || wrappedItemType != CalendarItemTypeWrapper.Single || flag) { this.RenderIcons(writer, 3, flag2, wrappedItemType, flag); } writer.Write("</td><td class=\"spc\"></td>"); break; case 2: writer.Write("<td class=\"spc\"></td><td class=\"lt\" align=\"center\">"); this.RenderSubject(writer, subject, 64, startTime, endTime, location, true, isMeeting, itemId); if (flag2 || wrappedItemType != CalendarItemTypeWrapper.Single || flag) { this.RenderIcons(writer, 3, flag2, wrappedItemType, flag); } this.RenderNextDayImage(writer, altAndTitleText2); break; case 3: this.RenderPreviousDayImage(writer, altAndTitleText); writer.Write("<td align=\"center\">"); this.RenderSubject(writer, subject, 64, startTime, endTime, location, true, isMeeting, itemId); if (flag2 || wrappedItemType != CalendarItemTypeWrapper.Single || flag) { this.RenderIcons(writer, 3, flag2, wrappedItemType, flag); } this.RenderNextDayImage(writer, altAndTitleText2); break; } writer.Write("</tr>"); } num++; } writer.Write("</table>"); }
// Token: 0x06000E39 RID: 3641 RVA: 0x0004E5BA File Offset: 0x0004C7BA public void SetValue(ProtocolLoggerData dataType, ExDateTime value) { this.storedData[dataType] = value; }
private void RenderSubject(TextWriter writer, string subject, int maxCharacters, ExDateTime startDateTime, ExDateTime endDateTime, string location, bool isEvent, bool isMeeting, OwaStoreObjectId itemId) { if (Utilities.WhiteSpaceOnlyOrNullEmpty(subject)) { if (isMeeting) { subject = LocalizedStrings.GetNonEncoded(-1500721828); } else { subject = LocalizedStrings.GetNonEncoded(-1178892512); } } StringBuilder stringBuilder = new StringBuilder(); if (isEvent) { stringBuilder.Append(startDateTime.ToString(this.UserContext.UserOptions.DateFormat)); stringBuilder.Append(" "); } stringBuilder.Append(startDateTime.ToString(this.UserContext.UserOptions.TimeFormat)); stringBuilder.Append(" - "); if (isEvent) { stringBuilder.Append(endDateTime.ToString(this.UserContext.UserOptions.DateFormat)); stringBuilder.Append(" "); } stringBuilder.Append(endDateTime.ToString(this.UserContext.UserOptions.TimeFormat)); stringBuilder.Append(" , "); stringBuilder.Append(Utilities.HtmlEncode(subject)); if (!string.IsNullOrEmpty(location)) { stringBuilder.Append("; "); stringBuilder.Append(Utilities.HtmlEncode(location)); } writer.Write("<h1 class=\"bld\"><a href=\"#\" onClick=\"return onClkM('{0}')\" title=\"{1}\">", HttpUtility.UrlEncode(itemId.StoreObjectId.ToBase64String()), stringBuilder.ToString()); Utilities.CropAndRenderText(writer, subject, maxCharacters); writer.Write("</a></h1>"); }
// Token: 0x06000783 RID: 1923 RVA: 0x0003956D File Offset: 0x0003776D internal Breadcrumb(ExDateTime timestamp, string text) { this.timestamp = timestamp; this.text = text; }
static AsyncOperationNotificationEmail() { AsyncOperationNotificationEmail.bodyTable = new Dictionary <AsyncOperationType, Dictionary <AsyncOperationNotificationEmailType, string> > { { AsyncOperationType.CertExpiry, new Dictionary <AsyncOperationNotificationEmailType, string> { { AsyncOperationNotificationEmailType.CertExpiring, ServerStrings.NotificationEmailBodyCertExpiring }, { AsyncOperationNotificationEmailType.CertExpired, ServerStrings.NotificationEmailBodyCertExpired } } }, { AsyncOperationType.ExportPST, new Dictionary <AsyncOperationNotificationEmailType, string> { { AsyncOperationNotificationEmailType.Created, ServerStrings.NotificationEmailBodyExportPSTCreated }, { AsyncOperationNotificationEmailType.Completed, ServerStrings.NotificationEmailBodyExportPSTCompleted }, { AsyncOperationNotificationEmailType.Failed, ServerStrings.NotificationEmailBodyExportPSTFailed } } }, { AsyncOperationType.ImportPST, new Dictionary <AsyncOperationNotificationEmailType, string> { { AsyncOperationNotificationEmailType.Created, ServerStrings.NotificationEmailBodyImportPSTCreated }, { AsyncOperationNotificationEmailType.Completed, ServerStrings.NotificationEmailBodyImportPSTCompleted }, { AsyncOperationNotificationEmailType.Failed, ServerStrings.NotificationEmailBodyImportPSTFailed } } } }; Dictionary <string, Func <AsyncOperationNotificationEmail, string, string> > dictionary = new Dictionary <string, Func <AsyncOperationNotificationEmail, string, string> >(); dictionary.Add("ExpireDate", (AsyncOperationNotificationEmail email, string key) => ExDateTime.FromFileTimeUtc(long.Parse(email.notification.GetExtendedAttributeValue(key))).ToShortDateString()); dictionary.Add("StartedBy", delegate(AsyncOperationNotificationEmail email, string key) { if (email.notification.StartedBy != null) { return(email.notification.StartedBy.ToString()); } return(string.Empty); }); dictionary.Add("StartTime", (AsyncOperationNotificationEmail email, string key) => email.notification.StartTime.ToString()); dictionary.Add("RunTime", delegate(AsyncOperationNotificationEmail email, string key) { if (email.notification.LastModified == null || email.notification.StartTime == null) { return(string.Empty); } return(email.notification.LastModified.Value.Subtract(email.notification.StartTime.Value).ToString()); }); dictionary.Add("DisplayName", (AsyncOperationNotificationEmail email, string key) => email.notification.DisplayName.ToString()); dictionary.Add("EcpUrl", (AsyncOperationNotificationEmail email, string key) => email.GetEcpUrl()); AsyncOperationNotificationEmail.bodyVariableGetters = dictionary; AsyncOperationNotificationEmail.bodyFormatRegex = new Regex("\\$_\\.(?<key>\\w+)", RegexOptions.Multiline | RegexOptions.Compiled); }
// Token: 0x060016B8 RID: 5816 RVA: 0x00088EA4 File Offset: 0x000870A4 public bool FirstTimeSync(Dictionary <ISyncItemId, FolderSync.ClientStateInformation> clientManifest, FirstTimeSyncWatermark minWatermark, QueryFilter filter, int numOperations, Dictionary <ISyncItemId, ServerManifestEntry> newServerManifest) { ExDateTime receivedDateUtc = minWatermark.ReceivedDateUtc; if (numOperations < 0 && numOperations != -1) { throw new ArgumentException("numOperations is not valid, value = " + numOperations); } AirSyncDiagnostics.TraceInfo <int, QueryFilter>(ExTraceGlobals.SyncProcessTracer, this, "FirstTimeSyncProvider.FirstTimeSync. numOperations = {0} filter = {1}", numOperations, filter); ExDateTime? filterTypeBoundary = this.GetFilterTypeBoundary(filter); MailboxSyncPropertyBag mailboxSyncPropertyBag = new MailboxSyncPropertyBag(FirstTimeSyncProvider.newQueryProps); if (filter != null) { mailboxSyncPropertyBag.AddColumnsFromFilter(filter); } int num; using (QueryResult positionedQueryResult = this.GetPositionedQueryResult(minWatermark, filterTypeBoundary, mailboxSyncPropertyBag.Columns, out num)) { bool flag = false; while (!flag) { if (newServerManifest.Count >= numOperations && numOperations > 0) { return(!flag); } int num2; if (numOperations == -1) { num2 = 10000; } else { int num3 = numOperations - newServerManifest.Count; num2 = num3 + 1; } if (num2 < 0) { throw new InvalidOperationException(ServerStrings.ExNumberOfRowsToFetchInvalid(num2.ToString())); } bool flag2 = false; if (num >= 0 && num < num2) { AirSyncDiagnostics.TraceDebug <int, int>(ExTraceGlobals.SyncProcessTracer, this, "[FirstTimeSyncProvier.FirstTimeSync] Limiting rows to fetch based on end filter. Original value: {0}, Filter Based Value: {1}", num2, num + 1); num2 = num; flag2 = true; } if (num2 <= 0) { AirSyncDiagnostics.TraceDebug(ExTraceGlobals.SyncProcessTracer, this, "[FirstTimeSyncProvider.FirstTimeSync] No more rows to fetch. Bailing out."); flag = true; return(false); } AirSyncDiagnostics.TraceInfo <int>(ExTraceGlobals.SyncProcessTracer, this, "FirstTimeSyncProvider.FirstTimeSync. Asking queryResult for {0} rows", num2); IStorePropertyBag[] propertyBags = positionedQueryResult.GetPropertyBags(num2); AirSyncDiagnostics.TraceInfo <int>(ExTraceGlobals.SyncProcessTracer, this, "FirstTimeSyncProvider.FirstTimeSync. Retrieved {0} rows", propertyBags.Length); if (num > -1) { num -= propertyBags.Length; } flag = (propertyBags.Length == 0 || (flag2 && num == 0)); if (propertyBags.Length < num2) { flag |= (positionedQueryResult.CurrentRow == positionedQueryResult.EstimatedRowCount); } for (int i = 0; i < propertyBags.Length; i++) { VersionedId versionedId = null; IStorePropertyBag storePropertyBag = propertyBags[i]; try { if (numOperations != -1 && newServerManifest.Count >= numOperations) { return(true); } if (!this.TryGetPropertyFromBag <VersionedId>(storePropertyBag, ItemSchema.Id, out versionedId)) { AirSyncDiagnostics.TraceError(ExTraceGlobals.SyncProcessTracer, this, "[FirstTimeSyncProvider.FirstTimeSync] Could not get versioned Id from property bag. Skipping item."); } else { ExDateTime exDateTime; bool flag3 = this.TryGetPropertyFromBag <ExDateTime>(storePropertyBag, ItemSchema.ReceivedTime, out exDateTime); if (!flag3 && filterTypeBoundary != null) { AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.SyncProcessTracer, this, "FirstTimeSyncProvider.FirstTimeSync. Found item with missing/corrupt DateTimeReceived. Bailing out of FirstTimeSync mode. Mailbox: {0} ItemId: {1}", this.folder.Session.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(), versionedId.ObjectId.ToBase64String()); flag = true; return(false); } ExDateTime value = exDateTime; if (!flag3 && !this.TryGetPropertyFromBag <ExDateTime>(storePropertyBag, StoreObjectSchema.CreationTime, out value)) { AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.SyncProcessTracer, this, "FirstTimeSyncProvider.FirstTimeSync. Found item with missing/corrupt CreationDate. Will use DateTime.MinValue instead. Mailbox: {0}, ItemId: {1}", this.folder.Session.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(), versionedId.ObjectId.ToBase64String()); } if (filterTypeBoundary != null && exDateTime < filterTypeBoundary) { AirSyncDiagnostics.TraceDebug <ExDateTime>(ExTraceGlobals.SyncProcessTracer, this, "[FirstTimeSyncProvider.FirstTimeSync] Passed our sync cutoff date of {0}. All rows fetched.", filterTypeBoundary.Value); flag = true; return(false); } int num4; if (!this.TryGetPropertyFromBag <int>(storePropertyBag, ItemSchema.ArticleId, out num4)) { AirSyncDiagnostics.TraceDebug <VersionedId>(ExTraceGlobals.SyncProcessTracer, this, "[FirstTimeSyncProvider.FirstTimeSync] Unable to get articleId from property bag item. Id: {0}", versionedId); } else { ISyncItemId syncItemId = MailboxSyncItemId.CreateForNewItem(versionedId.ObjectId); FolderSync.ClientStateInformation clientStateInformation; if (clientManifest != null && clientManifest.TryGetValue(syncItemId, out clientStateInformation) && clientStateInformation.ClientHasItem) { AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.SyncProcessTracer, this, "[FirstTimeSyncProvider.FirstTimeSync] Skipping item {0} because it is already in client manifest.", syncItemId.NativeId.ToString()); minWatermark.ChangeNumber = num4; minWatermark.ReceivedDateUtc = exDateTime; } else if (filter != null && !EvaluatableFilter.Evaluate(filter, storePropertyBag)) { AirSyncDiagnostics.TraceInfo <StoreObjectId, ExDateTime, int>(ExTraceGlobals.SyncTracer, this, "[FirstTimeSyncProvider.FirstTimeSync] Dropping item '{0}' because it failed to match our filter. ReceivedDateUtc: {1}, ChangeNumber: {2}", versionedId.ObjectId, exDateTime, num4); minWatermark.ChangeNumber = num4; minWatermark.ReceivedDateUtc = exDateTime; } else { bool read; if (!this.TryGetPropertyFromBag <bool>(storePropertyBag, MessageItemSchema.IsRead, out read)) { AirSyncDiagnostics.TraceDebug(ExTraceGlobals.SyncProcessTracer, this, "[FirstTimeSyncProvider.FirstTimeSync] Unabled to get read flag from property bag. Default to false."); read = false; } MailboxSyncWatermark mailboxSyncWatermark = MailboxSyncWatermark.Create(); mailboxSyncWatermark.UpdateWithChangeNumber(num4, read); AirSyncDiagnostics.TraceInfo(ExTraceGlobals.SyncTracer, this, "FirstTimeSyncProvider.FirstTimeSync. Adding Sync'd item {0} to manifest", new object[] { syncItemId.NativeId }); ServerManifestEntry serverManifestEntry = base.CreateItemChangeManifestEntry(syncItemId, mailboxSyncWatermark); ConversationId conversationId = null; if (this.TryGetPropertyFromBag <ConversationId>(storePropertyBag, ItemSchema.ConversationId, out conversationId)) { serverManifestEntry.ConversationId = conversationId; } byte[] bytes; ConversationIndex index; if (this.TryGetPropertyFromBag <byte[]>(storePropertyBag, ItemSchema.ConversationIndex, out bytes) && ConversationIndex.TryCreate(bytes, out index) && index != ConversationIndex.Empty && index.Components != null && index.Components.Count == 1) { AirSyncDiagnostics.TraceInfo(ExTraceGlobals.SyncTracer, this, "FirstTimeSyncProvider.FirstTimeSync. First message in conversation.", new object[] { syncItemId.NativeId }); serverManifestEntry.FirstMessageInConversation = true; } serverManifestEntry.FilterDate = new ExDateTime?(value); string text; if (this.TryGetPropertyFromBag <string>(storePropertyBag, StoreObjectSchema.ItemClass, out text)) { serverManifestEntry.MessageClass = (storePropertyBag[StoreObjectSchema.ItemClass] as string); } newServerManifest[serverManifestEntry.Id] = serverManifestEntry; minWatermark.ChangeNumber = num4; minWatermark.ReceivedDateUtc = exDateTime; } } } } catch (Exception arg) { AirSyncDiagnostics.TraceError <string, Exception>(ExTraceGlobals.SyncTracer, this, "FirstTimeSyncProvider.FirstTimeSync. Caught exception processing item: {0}. Exception: {1}", (versionedId == null) ? "<NULL>" : versionedId.ToBase64String(), arg); throw; } } } } return(false); }
private void FilterSuggestions(List <Suggestion> suggestionList, ConfigOptions options, ExDateTime currentMeetingTime) { suggestionList.RemoveAll((Suggestion suggestion) => !(suggestion.MeetingTime == (DateTime)currentMeetingTime) && (suggestion.TimeSlotRating == -1L || suggestion.SuggestionQuality > options.MinimumSuggestionQuality) && options.MinimumSuggestionQuality != SuggestionQuality.Poor); SuggestionDayResult.Tracer.TraceDebug <object, int>((long)this.GetHashCode(), "{0}: {1} suggestions passing minimum quality.", TraceContext.Get(), suggestionList.Count); suggestionList.Sort(delegate(Suggestion x, Suggestion y) { if (x == y) { return(0); } if (x.MeetingTime == (DateTime)currentMeetingTime) { return(-1); } if (y.MeetingTime == (DateTime)currentMeetingTime) { return(1); } if (x.TimeSlotRating == y.TimeSlotRating) { if (x.MeetingTime < y.MeetingTime) { return(-1); } if (x.MeetingTime > y.MeetingTime) { return(1); } return(0); } else { if (x.TimeSlotRating > y.TimeSlotRating) { return(1); } return(-1); } }); int num = 0; for (int i = 0; i < suggestionList.Count; i++) { if (!suggestionList[i].IsWorkTime) { if (num >= options.MaximumNonWorkHourResultsPerDay) { suggestionList.RemoveAt(i); i--; } else { num++; } } } SuggestionDayResult.Tracer.TraceDebug <object, int>((long)this.GetHashCode(), "{0}: {1} suggestions after non-working hour restrictions.", TraceContext.Get(), suggestionList.Count); if (suggestionList.Count > options.MaximumResultsPerDay) { suggestionList.RemoveRange(options.MaximumResultsPerDay, suggestionList.Count - options.MaximumResultsPerDay); SuggestionDayResult.Tracer.TraceDebug <object, int>((long)this.GetHashCode(), "{0}: suggestions array length shortened to MaximumResultsPerDay ({1}).", TraceContext.Get(), options.MaximumResultsPerDay); } }
public void LoadTombstoneRecords(byte[] tombstoneInfo, int monthsCount) { if (tombstoneInfo != null) { List <TombstoneRecord> list = new List <TombstoneRecord>(); ExDateTime exDateTime = new ExDateTime(ExTimeZone.UtcTimeZone, ExDateTime.Now.Year, ExDateTime.Now.Month, 1); ExDateTime exDateTime2 = ExDateTime.UtcNow.AddDays((double)(CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek - ExDateTime.UtcNow.DayOfWeek)); exDateTime2 = new ExDateTime(ExTimeZone.UtcTimeZone, exDateTime2.Year, exDateTime2.Month, exDateTime2.Day); ExDateTime t = (exDateTime < exDateTime2) ? exDateTime : exDateTime2; ExDateTime t2 = t.AddMonths(monthsCount); try { using (MemoryStream memoryStream = new MemoryStream(tombstoneInfo)) { using (BinaryReader binaryReader = new BinaryReader(memoryStream, CTSGlobals.AsciiEncoding)) { byte[] array = new byte[4]; binaryReader.Read(array, 0, 4); if (BitConverter.ToUInt32(array, 0) != 3202265037U) { ExTraceGlobals.MeetingMessageTracer.TraceError <string>((long)this.GetHashCode(), "AppointmentTombstone.Identifier field MUST have a value of 0xBEDEAFCD. Value found in the stream: {0}", BitConverter.ToUInt32(array, 0).ToString("X")); throw new CorruptDataException(ServerStrings.AppointmentTombstoneCorrupt); } binaryReader.Read(array, 0, 4); if (BitConverter.ToUInt32(array, 0) != 20U) { ExTraceGlobals.MeetingMessageTracer.TraceError <string>((long)this.GetHashCode(), "AppointmentTombstone.Headersize field MUST have a value of 0x00000014. Value found in the stream: {0}", BitConverter.ToUInt32(array, 0).ToString("X")); throw new CorruptDataException(ServerStrings.AppointmentTombstoneCorrupt); } binaryReader.Read(array, 0, 4); if (BitConverter.ToUInt32(array, 0) != 3U) { ExTraceGlobals.MeetingMessageTracer.TraceError <string>((long)this.GetHashCode(), "AppointmentTombstone.Version field MUST have a value of 0x00000003. Value found in the stream: {0}", BitConverter.ToUInt32(array, 0).ToString("X")); throw new CorruptDataException(ServerStrings.AppointmentTombstoneCorrupt); } binaryReader.Read(array, 0, 4); int num = BitConverter.ToInt32(array, 0); if (num <= 0) { ExTraceGlobals.MeetingMessageTracer.TraceError <int>((long)this.GetHashCode(), "AppointmentTombstone.Record count field MUST have a positive value. Value found in the stream {0}", num); throw new CorruptDataException(ServerStrings.AppointmentTombstoneCorrupt); } binaryReader.Read(array, 0, 4); if (BitConverter.ToUInt32(array, 0) != 20U) { ExTraceGlobals.MeetingMessageTracer.TraceError <string>((long)this.GetHashCode(), "AppointmentTombstone.RecordSize field MUST have a value of 0x00000014. Value found in the stream: {0}", BitConverter.ToUInt32(array, 0).ToString("X")); throw new CorruptDataException(ServerStrings.AppointmentTombstoneCorrupt); } for (int i = 0; i < num; i++) { binaryReader.Read(array, 0, 4); int num2 = BitConverter.ToInt32(array, 0); if (num2 <= 0) { ExTraceGlobals.MeetingMessageTracer.TraceError((long)this.GetHashCode(), "Tombstone record MUST have a positive start time value"); break; } binaryReader.Read(array, 0, 4); int num3 = BitConverter.ToInt32(array, 0); if (num3 <= 0) { ExTraceGlobals.MeetingMessageTracer.TraceError((long)this.GetHashCode(), "Tombstone record MUST have a positive end time value"); break; } binaryReader.Read(array, 0, 4); int num4 = BitConverter.ToInt32(array, 0); if (num4 <= 0) { ExTraceGlobals.MeetingMessageTracer.TraceError((long)this.GetHashCode(), "Tombstone record MUST have a positive global object id value"); break; } byte[] array2 = new byte[num4]; binaryReader.Read(array2, 0, num4); binaryReader.Read(array, 0, 2); short num5 = BitConverter.ToInt16(array, 0); if (num5 <= 0) { ExTraceGlobals.MeetingMessageTracer.TraceError((long)this.GetHashCode(), "Tombstone record MUST have a positive user name size value"); break; } byte[] array3 = new byte[(int)num5]; binaryReader.Read(array3, 0, (int)num5); TombstoneRecord tombstoneRecord = new TombstoneRecord { StartTime = ExDateTime.FromFileTimeUtc((long)num2 * 600000000L), EndTime = ExDateTime.FromFileTimeUtc((long)num3 * 600000000L), GlobalObjectId = array2, UserName = array3 }; if (tombstoneRecord.StartTime <= t2 && tombstoneRecord.EndTime >= t) { list.Add(tombstoneRecord); } } } } } catch (IOException ex) { ExTraceGlobals.MeetingMessageTracer.TraceError <string>((long)this.GetHashCode(), "Unable to process the tombstone record with exception:'{0}'", ex.Message); } catch (ArgumentOutOfRangeException ex2) { ExTraceGlobals.MeetingMessageTracer.TraceError <string>((long)this.GetHashCode(), "Unable to process the tombstone record with exception:'{0}'", ex2.Message); } catch (ArgumentException ex3) { ExTraceGlobals.MeetingMessageTracer.TraceError <string>((long)this.GetHashCode(), "Unable to process the tombstone record with exception:'{0}'", ex3.Message); } ExTraceGlobals.MeetingMessageTracer.Information <int>((long)this.GetHashCode(), "Number of tombstone records loaded: {0}", list.Count); this.tombstoneRecords = list.ToArray(); } }