private static void RenderMostRecentRecipientEntry(TextWriter writer, RecipientInfoCacheEntry entry) { if (writer == null) { throw new ArgumentNullException("writer"); } if (entry == null) { throw new ArgumentNullException("entry"); } ResolvedRecipientDetail resolvedRecipientDetail = new ResolvedRecipientDetail(entry); writer.Write("<option title=\""); Utilities.HtmlEncode(resolvedRecipientDetail.SmtpAddress, writer); writer.Write("\""); writer.Write(" value=\""); resolvedRecipientDetail.RenderConcatenatedDetails(false, writer); writer.Write("\">"); string text = string.Empty; if (!string.IsNullOrEmpty(resolvedRecipientDetail.DisplayName)) { text = resolvedRecipientDetail.DisplayName; } else if (!string.IsNullOrEmpty(resolvedRecipientDetail.SmtpAddress)) { text = resolvedRecipientDetail.SmtpAddress; } else if (!string.IsNullOrEmpty(resolvedRecipientDetail.RoutingAddress)) { text = resolvedRecipientDetail.RoutingAddress; } Utilities.CropAndRenderText(writer, text, 32); writer.Write("</option>"); }
public ResolvedRecipientDetail(string smtpAddress, string routingAddress, string displayName, string routingType, AddressOrigin addressOrigin, int recipientFlags, StoreObjectId storeObjectId, EmailAddressIndex emailAddressIndex, ADObjectId adObjectId) { this.smtpAddress = ResolvedRecipientDetail.EnsureNonNull(smtpAddress); this.routingAddress = ResolvedRecipientDetail.EnsureNonNull(routingAddress); this.displayName = ResolvedRecipientDetail.EnsureNonNull(displayName); this.routingType = ResolvedRecipientDetail.EnsureNonNull(routingType); this.addressOrigin = addressOrigin; this.recipientFlags = recipientFlags; this.storeObjectId = storeObjectId; this.adObjectId = adObjectId; this.emailAddressIndex = EmailAddressIndex.None; if (string.IsNullOrEmpty(displayName)) { this.displayName = this.smtpAddress; } if (this.storeObjectId != null) { this.itemId = this.storeObjectId.ToBase64String(); this.emailAddressIndex = emailAddressIndex; return; } if (this.adObjectId != null) { this.itemId = Convert.ToBase64String(this.adObjectId.ObjectGuid.ToByteArray()); return; } this.itemId = string.Empty; }
public ResolvedRecipientDetail(string smtpAddress, string routingAddress, string displayName, string routingType, AddressOrigin addressOrigin, int recipientFlags, string itemId, EmailAddressIndex emailAddressIndex) { this.smtpAddress = ResolvedRecipientDetail.EnsureNonNull(smtpAddress); this.routingAddress = ResolvedRecipientDetail.EnsureNonNull(routingAddress); this.displayName = ResolvedRecipientDetail.EnsureNonNull(displayName); this.routingType = ResolvedRecipientDetail.EnsureNonNull(routingType); this.addressOrigin = addressOrigin; this.recipientFlags = recipientFlags; this.itemId = ResolvedRecipientDetail.EnsureNonNull(itemId); this.emailAddressIndex = emailAddressIndex; if (string.IsNullOrEmpty(displayName)) { this.displayName = this.smtpAddress; } }
public static ResolvedRecipientDetail[] ParseFromForm(HttpRequest request, string parameterName, bool isRequired) { string[] array = ResolvedRecipientDetail.SplitConcatStringsFromForm(request, parameterName, isRequired); if (array.Length % 8 != 0) { throw new OwaInvalidRequestException("Invalid account of resolved recipient details. Details received:" + string.Join("\n", array)); } int num = array.Length / 8; List <ResolvedRecipientDetail> list = new List <ResolvedRecipientDetail>(); for (int i = 0; i < num; i++) { int num2 = i * 8; string text = array[num2]; string text2 = array[num2 + 1]; string text3 = array[num2 + 2]; string text4 = array[num2 + 3]; string s = array[num2 + 4]; string s2 = array[num2 + 5]; string text5 = array[num2 + 6]; string s3 = array[num2 + 7]; int num3; if (!int.TryParse(s, out num3)) { throw new OwaInvalidRequestException("The addressOrigin should be a valid integerDetails received:" + string.Join("\n", array)); } AddressOrigin addressOrigin = (AddressOrigin)num3; int num4; if (!int.TryParse(s3, out num4)) { throw new OwaInvalidRequestException("The emailAddressIndex should be a valid integerDetails received:" + string.Join("\n", array)); } EmailAddressIndex emailAddressIndex = (EmailAddressIndex)num4; int num5; if (!int.TryParse(s2, out num5)) { throw new OwaInvalidRequestException("The recipientFlags should be a valid integerDetails received:" + string.Join("\n", array)); } ResolvedRecipientDetail item = new ResolvedRecipientDetail(text, text2, text3, text4, addressOrigin, num5, text5, emailAddressIndex); list.Add(item); } return(list.ToArray()); }
public void RenderConcatenatedDetails(bool requireJavascriptEncode, TextWriter writer) { string[] array = new string[8]; array[0] = this.smtpAddress; array[1] = this.routingAddress; array[2] = this.displayName; array[3] = this.routingType; string[] array2 = array; int num = 4; int num2 = (int)this.addressOrigin; array2[num] = num2.ToString(); array[5] = this.recipientFlags.ToString(); array[6] = this.itemId; string[] array3 = array; int num3 = 7; int num4 = (int)this.emailAddressIndex; array3[num3] = num4.ToString(); ResolvedRecipientDetail.ConcatAndRenderMultiStringsAsOneValue(requireJavascriptEncode, writer, array); }
// Token: 0x060000C0 RID: 192 RVA: 0x00006DF0 File Offset: 0x00004FF0 protected override bool RenderAnrContents(TextWriter writer, UserContext userContext, RecipientWellType type, bool isTableStartRendered) { bool flag = isTableStartRendered; bool flag2 = false; if (this.HasRecipients(type)) { AdRecipientBatchQuery adRecipientBatchQuery = new AdRecipientBatchQuery(this.GetRecipientCollection(type), this.UserContext); IEnumerator <Participant> recipientCollection = this.GetRecipientCollection(type); string empty = string.Empty; int num = 0; List <RecipientAddress> list = new List <RecipientAddress>(); RecipientItemType recipientItemType = ItemRecipientWell.GetRecipientItemType(type); int num2 = 0; while (recipientCollection.MoveNext()) { Participant participant = recipientCollection.Current; string text = ItemRecipientWell.BuildRecipientIdString(recipientItemType, num2++); if (string.CompareOrdinal(participant.RoutingType, "MAPIPDL") != 0 && (string.IsNullOrEmpty(participant.EmailAddress) || string.IsNullOrEmpty(participant.RoutingType)) && !string.IsNullOrEmpty(participant.DisplayName)) { num = 0; ADObjectId adobjectId = null; int num3; ItemRecipientWell.GetSmtpAddressAndADObjectInfo(participant, adRecipientBatchQuery, out adobjectId, out num, out num3); StoreParticipantOrigin storeParticipantOrigin = participant.Origin as StoreParticipantOrigin; if (storeParticipantOrigin != null) { StoreObjectId originItemId = storeParticipantOrigin.OriginItemId; } if (!flag) { writer.Write("<table cellspacing=0 cellpadding=0 class=\"anrot\" id=\"tblANR\"><tr><td class=\"msg\"><h1 tabindex=0>"); writer.Write(LocalizedStrings.GetHtmlEncoded(147143837)); writer.Write("</h1></td></tr><tr><td class=\"h100\"><table cellspacing=0 cellpadding=0 class=\"anrit\">"); flag = true; } if (!flag2) { string value = null; if (this is CalendarItemRecipientWell) { switch (type) { case RecipientWellType.To: value = LocalizedStrings.GetHtmlEncoded(609567352); break; case RecipientWellType.Cc: value = LocalizedStrings.GetHtmlEncoded(633037671); break; case RecipientWellType.Bcc: value = LocalizedStrings.GetHtmlEncoded(-1107183092); break; } } else { switch (type) { case RecipientWellType.To: value = LocalizedStrings.GetHtmlEncoded(-1105875540); break; case RecipientWellType.Cc: value = LocalizedStrings.GetHtmlEncoded(701860997); break; case RecipientWellType.Bcc: value = LocalizedStrings.GetHtmlEncoded(1482538735); break; } } writer.Write("<tr><td class=\"hdr\" tabindex=0>"); writer.Write(value); writer.Write("</td></tr>"); flag2 = true; } writer.Write("<tr><td class=\"rcpt\" nowrap><span tabindex=0>"); Utilities.CropAndRenderText(writer, participant.DisplayName, 24); writer.Write("</span> [<a href=\"#\" title=\""); writer.Write(Utilities.HtmlEncode(participant.DisplayName)); writer.Write("\" onClick=\"return onClkRmRcp('{0}')\">{1}</a>]", text, LocalizedStrings.GetHtmlEncoded(341226654)); writer.Write("</td></tr>"); list.Clear(); AnrManager.ResolveOneRecipient(participant.DisplayName, userContext, list); if (list.Count == 0) { RecipientAddress recipientAddress = AnrManager.ResolveAnrStringToOneOffEmail(participant.DisplayName); if (recipientAddress != null) { list.Add(recipientAddress); } } int num4 = 0; while (num4 < list.Count && num4 < 100) { RecipientAddress recipientAddress2 = list[num4]; if (recipientAddress2.DisplayName != null) { writer.Write("<tr><td><a href=\"#\" title=\""); Utilities.HtmlEncode(recipientAddress2.DisplayName, writer); if (recipientAddress2.SmtpAddress != null) { writer.Write(" ["); Utilities.HtmlEncode(recipientAddress2.SmtpAddress, writer); writer.Write("]"); } writer.Write("\" onClick=\"return onClkAddAnr(this,'"); ResolvedRecipientDetail resolvedRecipientDetail = new ResolvedRecipientDetail(recipientAddress2); resolvedRecipientDetail.RenderConcatenatedDetails(true, writer); writer.Write("',"); writer.Write((int)recipientItemType); writer.Write(",'"); writer.Write(text); writer.Write("')\">"); Utilities.CropAndRenderText(writer, recipientAddress2.DisplayName, 24); if (string.IsNullOrEmpty(recipientAddress2.DisplayName) && !string.IsNullOrEmpty(recipientAddress2.SmtpAddress)) { writer.Write("("); Utilities.CropAndRenderText(writer, recipientAddress2.SmtpAddress, 24); writer.Write(")"); } writer.Write("</a></td></tr>"); } num4++; } } } } return(flag); }