// Token: 0x0600029C RID: 668 RVA: 0x000174B4 File Offset: 0x000156B4 private void RenderMru(TextWriter writer) { if (this.mruFolderList.Count > 0) { writer.Write("<table cellspacing=0 cellpadding=0 class=\"snt\">"); for (int i = 0; i < this.mruFolderList.Count; i++) { MruFolderItem mruFolderItem = this.mruFolderList[i]; int count = 0; ContentCountDisplay contentCountDisplay = FolderUtility.GetContentCountDisplay(mruFolderItem.ExtendedFolderFlags, mruFolderItem.Id); if (contentCountDisplay == ContentCountDisplay.ItemCount) { count = mruFolderItem.ItemCount; } else if (contentCountDisplay == ContentCountDisplay.UnreadCount) { count = mruFolderItem.UnreadCount; } this.RenderFolder(mruFolderItem.Id, mruFolderItem.DisplayName, count, contentCountDisplay, SecondaryNavigationArea.Mru, writer); } writer.Write("</table>"); base.RenderHorizontalDivider(writer); } }
private static void RenderFolderList(FolderList folderList, string defaultText, string[] folderTypes, StoreObjectId selectedFolderId, IDictionary <string, string> dropdownAttributes, FolderDropdown.FolderFilterOptions folderFilterOptions, FolderDropdown.RenderingOptions renderingOptions, UserContext userContext, TextWriter writer, params FolderDropDownFilterDelegate[] filters) { if (folderList == null) { throw new ArgumentNullException("folderList"); } writer.Write("<select"); if (dropdownAttributes != null) { foreach (KeyValuePair <string, string> keyValuePair in dropdownAttributes) { writer.Write(" "); writer.Write(keyValuePair.Key); writer.Write("=\""); writer.Write(keyValuePair.Value); writer.Write("\""); } } writer.Write(">"); if (!string.IsNullOrEmpty(defaultText)) { writer.Write("<option value=\"\" class=dddt>"); writer.Write(defaultText); writer.Write("</option>"); } if ((renderingOptions & FolderDropdown.RenderingOptions.Root) != FolderDropdown.RenderingOptions.None) { writer.Write("<option value=\""); Utilities.HtmlEncode(userContext.GetRootFolderId(userContext.MailboxSession).ToBase64String(), writer); writer.Write("\""); if (Utilities.IsDefaultFolderId(userContext.MailboxSession, selectedFolderId, DefaultFolderType.Root)) { writer.Write(" selected"); } writer.Write(">"); Utilities.HtmlEncode(userContext.ExchangePrincipal.MailboxInfo.DisplayName, writer); writer.Write("</option>"); } for (int i = 0; i < folderList.Count; i++) { StoreObjectId objectId = ((VersionedId)folderList.GetPropertyValue(i, FolderSchema.Id)).ObjectId; if (((folderFilterOptions & FolderDropdown.FolderFilterOptions.SpecialFolders) != FolderDropdown.FolderFilterOptions.None || !Utilities.IsSpecialFolder(objectId, userContext)) && ((folderFilterOptions & FolderDropdown.FolderFilterOptions.DeletedItemsFolder) != FolderDropdown.FolderFilterOptions.None || !Utilities.IsDefaultFolderId(userContext.MailboxSession, objectId, DefaultFolderType.DeletedItems)) && ((folderFilterOptions & FolderDropdown.FolderFilterOptions.DeletedFolders) != FolderDropdown.FolderFilterOptions.None || !folderList.IsFolderDeleted(i))) { bool flag = false; for (int j = 0; j < filters.Length; j++) { if (!filters[j](folderList, objectId)) { flag = true; break; } } if (!flag) { string text = folderList.GetPropertyValue(i, StoreObjectSchema.ContainerClass) as string; if (!folderList.IsFolderDeleted(i)) { if (text == null) { if ((folderFilterOptions & FolderDropdown.FolderFilterOptions.UnknownFolderType) == FolderDropdown.FolderFilterOptions.None) { goto IL_4A9; } } else if (folderTypes == null) { if ((folderFilterOptions & FolderDropdown.FolderFilterOptions.FoldersAbleToViewInMailModule) != FolderDropdown.FolderFilterOptions.None) { if (ObjectClass.IsCalendarFolder(text)) { goto IL_4A9; } if (ObjectClass.IsContactsFolder(text)) { goto IL_4A9; } } } else { bool flag2 = false; for (int k = 0; k < folderTypes.Length; k++) { if (ObjectClass.IsOfClass(text, folderTypes[k])) { flag2 = true; break; } } if (!flag2) { goto IL_4A9; } } } if (text == null || !Utilities.IsFolderSegmentedOut(text, userContext)) { writer.Write("<option value=\""); if ((renderingOptions & FolderDropdown.RenderingOptions.WholeLinkAsOptionValue) != FolderDropdown.RenderingOptions.None) { Utilities.HtmlEncode(Utilities.UrlEncode(text ?? "IPF.Note"), writer); Utilities.HtmlEncode("&", writer); writer.Write("id"); writer.Write("="); Utilities.HtmlEncode(Utilities.UrlEncode(objectId.ToBase64String()), writer); if (!FolderUtility.IsPrimaryMailFolder(objectId, userContext) && !folderList.IsFolderDeleted(i)) { Utilities.HtmlEncode("&mru=1", writer); } } else { Utilities.HtmlEncode(objectId.ToBase64String(), writer); } writer.Write("\""); if ((renderingOptions & FolderDropdown.RenderingOptions.FolderDisplayNameAsTitle) != FolderDropdown.RenderingOptions.None) { writer.Write(" title=\""); string text2 = folderList.GetPropertyValue(i, FolderSchema.DisplayName) as string; if (text2 != null) { Utilities.HtmlEncode(text2, writer); } writer.Write("\""); } if (Utilities.IsSpecialFolder(objectId, userContext)) { writer.Write(" class=sf "); } else if (folderList.IsFolderDeleted(i)) { writer.Write(" class=df "); } if (objectId.Equals(selectedFolderId)) { writer.Write(" selected"); } writer.Write(">"); int num = 0; if ((renderingOptions & FolderDropdown.RenderingOptions.Hierarchy) != FolderDropdown.RenderingOptions.None) { int num2 = (int)folderList.GetPropertyValue(i, FolderSchema.FolderHierarchyDepth); num = (((renderingOptions & FolderDropdown.RenderingOptions.Root) != FolderDropdown.RenderingOptions.None) ? 1 : 0) + num2 - 1; if (num * 2 > 24) { num = 12; } for (int l = 0; l < num; l++) { writer.Write(". "); } } int num3 = 24 - num * 2; if (num3 > 0) { Utilities.CropAndRenderText(writer, (string)folderList.GetPropertyValue(i, FolderSchema.DisplayName), num3); } if ((renderingOptions & FolderDropdown.RenderingOptions.ItemCount) != FolderDropdown.RenderingOptions.None) { object propertyValue = folderList.GetPropertyValue(i, FolderSchema.ExtendedFolderFlags); ContentCountDisplay contentCountDisplay = FolderUtility.GetContentCountDisplay(propertyValue, objectId); if (contentCountDisplay == ContentCountDisplay.ItemCount) { int num4 = (int)folderList.GetPropertyValue(i, FolderSchema.ItemCount); if (num4 > 0) { writer.Write(" [" + num4 + "]"); } } else if (contentCountDisplay == ContentCountDisplay.UnreadCount) { int num5 = (int)folderList.GetPropertyValue(i, FolderSchema.UnreadCount); if (num5 > 0) { writer.Write(" (" + num5 + ")"); } } } writer.Write("</option>"); } } } IL_4A9 :; } writer.Write("</select>"); }
// Token: 0x0600029A RID: 666 RVA: 0x00017160 File Offset: 0x00015360 private void RenderSpecialFolderNavigation(TextWriter writer) { UserContext userContext = this.owaContext.UserContext; writer.Write("<table cellspacing=0 cellpadding=0 class=\"snt\">"); if (this.folderList != null) { for (int i = 0; i < this.folderList.Count; i++) { StoreObjectId objectId = ((VersionedId)this.folderList.GetPropertyValue(i, FolderSchema.Id)).ObjectId; if (FolderUtility.IsPrimaryMailFolder(objectId, userContext)) { ContentCountDisplay contentCountDisplay = FolderUtility.GetContentCountDisplay(this.folderList.GetPropertyValue(i, FolderSchema.ExtendedFolderFlags), objectId); int count = 0; if (contentCountDisplay == ContentCountDisplay.ItemCount) { count = (int)this.folderList.GetPropertyValue(i, FolderSchema.ItemCount); } else if (contentCountDisplay == ContentCountDisplay.UnreadCount) { count = (int)this.folderList.GetPropertyValue(i, FolderSchema.UnreadCount); } this.RenderFolder(objectId, (string)this.folderList.GetPropertyValue(i, FolderSchema.DisplayName), count, contentCountDisplay, SecondaryNavigationArea.Special, writer); } } } else { Dictionary <PropertyDefinition, int> folderPropertyToIndexInBasic = FolderList.FolderPropertyToIndexInBasic; using (Folder folder = Folder.Bind(userContext.MailboxSession, userContext.GetRootFolderId(userContext.MailboxSession))) { using (QueryResult queryResult = folder.FolderQuery(FolderQueryFlags.None, null, null, FolderList.FolderPropertiesInBasic)) { for (;;) { object[][] rows = queryResult.GetRows(10000); if (rows.Length <= 0) { break; } foreach (object[] array in rows) { StoreObjectId objectId2 = ((VersionedId)array[folderPropertyToIndexInBasic[FolderSchema.Id]]).ObjectId; if (FolderUtility.IsPrimaryMailFolder(objectId2, userContext)) { object extendedFolderFlagValue = array[folderPropertyToIndexInBasic[FolderSchema.ExtendedFolderFlags]]; ContentCountDisplay contentCountDisplay2 = FolderUtility.GetContentCountDisplay(extendedFolderFlagValue, objectId2); int count2 = 0; if (contentCountDisplay2 == ContentCountDisplay.ItemCount) { count2 = (int)array[folderPropertyToIndexInBasic[FolderSchema.ItemCount]]; } else if (contentCountDisplay2 == ContentCountDisplay.UnreadCount) { count2 = (int)array[folderPropertyToIndexInBasic[FolderSchema.UnreadCount]]; } this.RenderFolder(objectId2, (string)array[folderPropertyToIndexInBasic[FolderSchema.DisplayName]], count2, contentCountDisplay2, SecondaryNavigationArea.Special, writer); } } } } } } writer.Write("</table>"); }
// Token: 0x0600029D RID: 669 RVA: 0x00017554 File Offset: 0x00015754 private void RenderFolder(StoreObjectId folderId, string folderDisplayName, int count, ContentCountDisplay contentCountDisplay, SecondaryNavigationArea secondaryNavigationArea, TextWriter writer) { UserContext userContext = this.owaContext.UserContext; writer.Write("<tr><td nowrap class=\"fld"); if (this.selectedUsing == secondaryNavigationArea && folderId.Equals(this.selectedFolderId)) { writer.Write(" sl"); } if (count > 0) { writer.Write(" bld"); } writer.Write("\"><a name=\"lnkFldr\" href=\"?ae=Folder&t=IPF.Note&id="); writer.Write(Utilities.UrlEncode(folderId.ToBase64String())); writer.Write("&slUsng="); writer.Write((int)secondaryNavigationArea); if (secondaryNavigationArea == SecondaryNavigationArea.Mru) { writer.Write("&mru=1"); } writer.Write("\" title=\""); Utilities.HtmlEncode(folderDisplayName, writer); writer.Write("\">"); writer.Write("<img src=\""); RenderingUtilities.RenderSpecialFolderIcon(writer, userContext, "IPF.Note", folderId); writer.Write("\" alt=\"\">"); Utilities.CropAndRenderText(writer, folderDisplayName, 24); writer.Write(" </a>"); if (count > 0) { if (contentCountDisplay == ContentCountDisplay.ItemCount) { writer.Write("<span class=\"itm\">["); writer.Write(count); writer.Write("]</span>"); } else if (contentCountDisplay == ContentCountDisplay.UnreadCount) { writer.Write("<span class=\"unrd\">("); writer.Write(count); writer.Write(")</span>"); } } writer.Write("</td></tr>"); }