示例#1
0
        private void CreatePagerPreviousButton(TableRow imageRow, TableRow textRow,
                                               ResultPagerLinkStyle style, int prevIndex)
        {
            TableCell cell;

            if (style == ResultPagerLinkStyle.TextWithImages)
            {
                cell = new TableCell();
                ImageButton prevImgButton = new ImageButton();
                prevImgButton.ImageUrl        = GoogleNavPreviousImageUrl;
                prevImgButton.CommandName     = "Page";
                prevImgButton.CommandArgument = prevIndex.ToString();

                cell.Controls.Add(prevImgButton);
                imageRow.Cells.Add(cell);
            }

            ResourceManager rm = ResourceFactory.Manager;

            cell = new TableCell();
            LinkButton prevButton = new LinkButton();

            prevButton.ID              = "PrevButton";
            prevButton.Text            = rm.GetString("Pager.prevButton.Text");
            prevButton.CommandName     = "Page";
            prevButton.CommandArgument = prevIndex.ToString();
            cell.HorizontalAlign       = HorizontalAlign.Right;
            cell.Controls.Add(prevButton);

            textRow.Cells.Add(cell);
        }
示例#2
0
        private void CreatePagerPageButton(TableRow imageRow, TableRow textRow,
                                           ResultPagerLinkStyle style, int pageNum, int pageIndex, bool currentPage)
        {
            TableCell      cell;
            LiteralControl lit;

            if (style == ResultPagerLinkStyle.TextWithImages)
            {
                cell = new TableCell();
                ImageButton pageImgButton = new ImageButton();
                pageImgButton.Width = 16;
                if (currentPage == true)
                {
                    pageImgButton.ImageUrl = GoogleNavCurrentImageUrl;
                }
                else
                {
                    pageImgButton.ImageUrl = GoogleNavPageImageUrl;
                }

                pageImgButton.CommandName     = "Page";
                pageImgButton.CommandArgument = pageIndex.ToString();

                cell.Controls.Add(pageImgButton);
                imageRow.Cells.Add(cell);
            }

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;

            // add extra separation between page numbers
            // if text only paging is used
            if (style == ResultPagerLinkStyle.Text)
            {
                lit      = new LiteralControl();
                lit.Text = " ";
                cell.Controls.Add(lit);
            }

            LinkButton pageButton = new LinkButton();

            pageButton.ID               = "page" + pageIndex.ToString() + "Button";
            pageButton.Text             = pageNum.ToString();
            pageButton.CommandName      = "Page";
            pageButton.CommandArgument  = pageIndex.ToString();
            pageButton.CausesValidation = true;
            if (currentPage == true)
            {
                pageButton.ControlStyle.Font.Bold = true;
            }

            cell.Controls.Add(pageButton);
            textRow.Cells.Add(cell);
        }
示例#3
0
        private void CreatePagerNextButton(TableRow imageRow, TableRow textRow,
                                           ResultPagerLinkStyle style, int nextIndex)
        {
            TableCell      cell = new TableCell();
            LiteralControl lit;

            if (style == ResultPagerLinkStyle.TextWithImages)
            {
                cell = new TableCell();
                cell.HorizontalAlign = HorizontalAlign.Left;
                ImageButton nextImgButton = new ImageButton();
                nextImgButton.ImageUrl        = GoogleNavNextImageUrl;
                nextImgButton.CommandName     = "Page";
                nextImgButton.CommandArgument = nextIndex.ToString();

                cell.Controls.Add(nextImgButton);
                imageRow.Cells.Add(cell);
            }

            cell = new TableCell();

            // add extra separation between page numbers
            // if text only paging is used
            if (style == ResultPagerLinkStyle.Text)
            {
                lit      = new LiteralControl();
                lit.Text = " ";
                cell.Controls.Add(lit);
            }

            ResourceManager rm = ResourceFactory.Manager;

            LinkButton nextButton = new LinkButton();

            nextButton.ID              = "nextButton";
            nextButton.Text            = rm.GetString("Pager.nextButton.Text");
            nextButton.CommandName     = "Page";
            nextButton.CommandArgument = nextIndex.ToString();
            cell.HorizontalAlign       = HorizontalAlign.Center;
            cell.Controls.Add(nextButton);

            textRow.Cells.Add(cell);
        }
示例#4
0
        private void CreatePagerResults(TableRow imageRow, TableRow textRow,
                                        ResultPagerLinkStyle style)
        {
            TableCell cell;

            if (style == ResultPagerLinkStyle.TextWithImages)
            {
                cell      = new TableCell();
                cell.Text = " ";
                imageRow.Cells.Add(cell);
            }

            cell = new TableCell();

            ResourceManager rm = ResourceFactory.Manager;

            cell.Text            = rm.GetString("Pager.resultsPageCell.Text");
            cell.Wrap            = false;
            cell.HorizontalAlign = HorizontalAlign.Center;
            textRow.Cells.Add(cell);
        }