private void BindNavigationLinks() { int pageCount = PagingUtils.CalculatePageCount(this.DirectoryList.Count, m_pageSize); this.MainContentHtml = this.MainContentHtml.Replace("[UpStatus]", m_pageIndex > 1 ? "On" : "Off"); this.MainContentHtml = this.MainContentHtml.Replace("[DownStatus]", m_pageIndex < pageCount ? "On" : "Off"); string previousPageLink = String.Empty; if (m_pageIndex > 1) { previousPageLink = this.GetTemplate("Browse\\PreviousPageLink.htm"); previousPageLink = previousPageLink.Replace("[PreviousPageUrl]", NavigationManager.GetBrowsePageUrl(this.BrowseUrl, m_pageIndex - 1)); } this.MainContentHtml = this.MainContentHtml.Replace("<PreviousPageLink>", previousPageLink); string nextPageLink = String.Empty; if (m_pageIndex < pageCount) { nextPageLink = this.GetTemplate("Browse\\NextPageLink.htm"); nextPageLink = nextPageLink.Replace("[NextPageUrl]", NavigationManager.GetBrowsePageUrl(this.BrowseUrl, m_pageIndex + 1)); } this.MainContentHtml = this.MainContentHtml.Replace("<NextPageLink>", nextPageLink); }
private void BindList() { string listEntryHtml = GetTemplate("Browse\\DirectoryListEntry.htm"); StringBuilder builder = new StringBuilder(); DirectoryListEntryCollection collection = this.DirectoryList; DirectoryListEntryCollection page = this.DirectoryListPage; int pageCount = PagingUtils.CalculatePageCount(this.DirectoryList.Count, m_pageSize); int index = 1; foreach (DirectoryListEntry entry in page) { string entryHtml = listEntryHtml; entryHtml = entryHtml.Replace("[Name]", entry.Name); entryHtml = entryHtml.Replace("[NavigateUrl]", entry.NavigateUrl); int displayOrder = (this.PageIndex - 1) * 10 + index; entryHtml = entryHtml.Replace("[DisplayOrder]", displayOrder.ToString()); entryHtml = entryHtml.Replace("[NextDisplayOrder]", (displayOrder + 1).ToString()); entryHtml = entryHtml.Replace("[IconName]", entry.IconName); if (m_pageIndex > 1 && index == 1) { entry.BrowserTags = entry.BrowserTags + " onkeyupset=\"prev\""; } if (m_pageIndex < pageCount && index == m_pageSize) { entry.BrowserTags = entry.BrowserTags + " onkeydownset=\"next\""; } entryHtml = entryHtml.Replace("[BrowserTags]", entry.BrowserTags); builder.Append(entryHtml); index++; } this.MainContentHtml = this.MainContentHtml.Replace("<List>", builder.ToString()); }