English versionEnglish
杨涛的个人主页

AspNetPager分页控件

AspNetPager源代码—Properties.cs

    1 //AspNetPager分页控件源代码:

    2 //版权所有:陕西省延安市吴起县博杨计算机有限公司 杨涛(Webdiyer)

    3 //此源代码仅供学习参考,不得用于任何商业用途;

    4 //您可以修改并重新编译该控件,但源代码中的版权信息必须原样保留!

    5 //有关控件升级及新控件发布信息,请留意 www.webdiyer.com 。

    6 

    7 using System;

    8 using System.ComponentModel;

    9 using System.IO;

   10 using System.Web.UI;

   11 using System.Web.UI.WebControls;

   12 

   13 namespace Wuqi.Webdiyer

   14 {

   15     public partial class AspNetPager

   16     {

   17         #region Private fields

   18 

   19         private enum NavigationButton : byte

   20         {

   21             First, Prev, Next, Last

   22         }

   23 

   24         //private string cssClassName;

   25         private string inputPageIndex;

   26         private string currentUrl;

   27         private string queryString;

   28         private AspNetPager cloneFrom;

   29         private static readonly object EventPageChanging = new object();

   30         private static readonly object EventPageChanged = new object();

   31         //bool pageChangeEventHandled = false;

   32         //AspNetPager Version number, does not use reflection for perfomance reason

   33         const string VersionNumber = "7.3.2";

   34 

   35         #endregion

   36 

   37 

   38         #region Navigation Buttons

   39 

   40         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowNavigationToolTip"]/*'/>

   41         [Browsable(true), ANPCategory("cat_Navigation"), DefaultValue(false), ANPDescription("desc_ShowNavigationToolTip"), Themeable(true)]

   42         public bool ShowNavigationToolTip

   43         {

   44             get

   45             {

   46                 if (null != cloneFrom)

   47                     return cloneFrom.ShowNavigationToolTip;

   48                 object obj = ViewState["ShowNvToolTip"];

   49                 return (obj == null) ? false : (bool)obj;

   50             }

   51             set

   52             {

   53                 ViewState["ShowNvToolTip"] = value;

   54             }

   55         }

   56 

   57         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NavigationToolTipTextFormatString"]/*'/>

   58         [Browsable(true), Themeable(true), ANPCategory("cat_Navigation"), ANPDefaultValue("def_NavigationToolTipTextFormatString"), ANPDescription("desc_NavigationToolTipTextFormatString")]

   59         public string NavigationToolTipTextFormatString

   60         {

   61             get

   62             {

   63                 if (null != cloneFrom)

   64                     return cloneFrom.NavigationToolTipTextFormatString;

   65                 object obj = ViewState["NvToolTipFormatString"];

   66                 if (obj == null)

   67                 {

   68                     if (ShowNavigationToolTip)

   69                         return SR.GetString("def_NavigationToolTipTextFormatString");

   70                     return null;

   71                 }

   72                 return (string)obj;

   73             }

   74             set

   75             {

   76                 string tip = value;

   77                 if (tip.Trim().Length < 1 && tip.IndexOf("{0}") < 0)

   78                     tip = "{0}";

   79                 ViewState["NvToolTipFormatString"] = tip;

   80             }

   81         }

   82 

   83         /// <include file='AspnetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NumericButtonTextFormatString"]/*'/>

   84         [Browsable(true), Themeable(true), DefaultValue(""), ANPCategory("cat_Navigation"), ANPDescription("desc_NBTFormatString")]

   85         public string NumericButtonTextFormatString

   86         {

   87             get

   88             {

   89                 if (null != cloneFrom)

   90                     return cloneFrom.NumericButtonTextFormatString;

   91                 object obj = ViewState["NumericButtonTextFormatString"];

   92                 return (obj == null) ? String.Empty : (string)obj;

   93             }

   94             set

   95             {

   96                 ViewState["NumericButtonTextFormatString"] = value;

   97             }

   98         }

   99 

  100         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CurrentPageButtonTextFormatString"]/*'/>

  101         [Browsable(true), Themeable(true), DefaultValue(""), ANPCategory("cat_Navigation"), ANPDescription("desc_CPBTextFormatString")]

  102         public string CurrentPageButtonTextFormatString

  103         {

  104             get

  105             {

  106                 if (null != cloneFrom)

  107                     return cloneFrom.CurrentPageButtonTextFormatString;

  108                 object obj = ViewState["CurrentPageButtonTextFormatString"];

  109                 return (obj == null) ? NumericButtonTextFormatString : (string)obj;

  110             }

  111             set

  112             {

  113                 ViewState["CurrentPageButtonTextFormatString"] = value;

  114             }

  115         }

  116 

  117 

  118         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PagingButtonType"]/*'/>

  119         [Browsable(true), Themeable(true), DefaultValue(PagingButtonType.Text), ANPCategory("cat_Navigation"), ANPDescription("desc_PagingButtonType")]

  120         public PagingButtonType PagingButtonType

  121         {

  122             get

  123             {

  124                 if (null != cloneFrom)

  125                     return cloneFrom.PagingButtonType;

  126                 object obj = ViewState["PagingButtonType"];

  127                 return (obj == null) ? PagingButtonType.Text : (PagingButtonType)obj;

  128             }

  129             set

  130             {

  131                 ViewState["PagingButtonType"] = value;

  132             }

  133         }

  134 

  135         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NumericButtonType"]/*'/>

  136         [Browsable(true), Themeable(true), DefaultValue(PagingButtonType.Text), ANPCategory("cat_Navigation"), ANPDescription("desc_NumericButtonType")]

  137         public PagingButtonType NumericButtonType

  138         {

  139             get

  140             {

  141                 if (null != cloneFrom)

  142                     return cloneFrom.NumericButtonType;

  143                 object obj = ViewState["NumericButtonType"];

  144                 return (obj == null) ? PagingButtonType : (PagingButtonType)obj;

  145             }

  146             set

  147             {

  148                 ViewState["NumericButtonType"] = value;

  149             }

  150         }

  151 

  152         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PagingButtonLayoutType"]/*'/>

  153         [Browsable(true), Themeable(true), DefaultValue(PagingButtonLayoutType.None), ANPCategory("cat_Navigation"), ANPDescription("desc_PagingButtonLayoutType")]

  154         public PagingButtonLayoutType PagingButtonLayoutType

  155         {

  156             get

  157             {

  158                 if (null != cloneFrom)

  159                     return cloneFrom.PagingButtonLayoutType;

  160                 object obj = ViewState["PagingButtonLayoutType"];

  161                 return (obj == null) ? PagingButtonLayoutType.None : (PagingButtonLayoutType)obj;

  162             }

  163             set { ViewState["PagingButtonLayoutType"] = value; }

  164         }

  165 

  166         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CurrentPageButtonPosition"]/*'/>

  167         [Browsable(true), Themeable(true), DefaultValue(PagingButtonPosition.Fixed), ANPCategory("cat_Navigation"), ANPDescription("desc_CurrentPageButtonPosition")]

  168         public PagingButtonPosition CurrentPageButtonPosition

  169         {

  170             get

  171             {

  172                 if (null != cloneFrom)

  173                     return cloneFrom.CurrentPageButtonPosition;

  174                 object obj = ViewState["CurrentPageButtonPosition"];

  175                 return (obj == null) ? PagingButtonPosition.Fixed : (PagingButtonPosition)obj;

  176             }

  177             set { ViewState["CurrentPageButtonPosition"] = value; }

  178         }

  179 

  180         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NavigationButtonsPosition"]/*'/>

  181         [Browsable(true), Themeable(true), DefaultValue(NavigationButtonPosition.BothSides), ANPCategory("cat_Navigation"), ANPDescription("desc_NavigationButtonsPosition")]

  182         public NavigationButtonPosition NavigationButtonsPosition

  183         {

  184             get

  185             {

  186                 if (null != cloneFrom)

  187                     return cloneFrom.NavigationButtonsPosition;

  188                 object obj = ViewState["NavigationButtonsPosition"];

  189                 return (obj == null) ? NavigationButtonPosition.BothSides : (NavigationButtonPosition)obj;

  190             }

  191             set { ViewState["NavigationButtonsPosition"] = value; }

  192 

  193         }

  194 

  195         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NavigationButtonType"]/*'/>

  196         [Browsable(true), Themeable(true), ANPCategory("cat_Navigation"), DefaultValue(PagingButtonType.Text), ANPDescription("desc_NavigationButtonType")]

  197         public PagingButtonType NavigationButtonType

  198         {

  199             get

  200             {

  201                 if (null != cloneFrom)

  202                     return cloneFrom.NavigationButtonType;

  203                 object obj = ViewState["NavigationButtonType"];

  204                 return (obj == null) ? PagingButtonType : (PagingButtonType)obj;

  205             }

  206             set

  207             {

  208                 ViewState["NavigationButtonType"] = value;

  209             }

  210         }

  211 

  212         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="UrlPagingTarget"]/*'/>

  213         [Browsable(true), Themeable(true), DefaultValue(""), TypeConverter(typeof(TargetConverter)), ANPCategory("cat_Navigation"), ANPDescription("desc_UrlPagingTarget")]

  214         public string UrlPagingTarget

  215         {

  216             get

  217             {

  218                 if (null != cloneFrom)

  219                     return cloneFrom.UrlPagingTarget;

  220                 return (string)ViewState["UrlPagingTarget"];

  221             }

  222             set

  223             {

  224                 ViewState["UrlPagingTarget"] = value;

  225             }

  226         }

  227 

  228         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="MoreButtonType"]/*'/>

  229         [Browsable(true), Themeable(true), ANPCategory("cat_Navigation"), DefaultValue(PagingButtonType.Text), ANPDescription("desc_MoreButtonType")]

  230         public PagingButtonType MoreButtonType

  231         {

  232             get

  233             {

  234                 if (null != cloneFrom)

  235                     return cloneFrom.MoreButtonType;

  236                 object obj = ViewState["MoreButtonType"];

  237                 return (obj == null) ? PagingButtonType : (PagingButtonType)obj;

  238             }

  239             set

  240             {

  241                 ViewState["MoreButtonType"] = value;

  242             }

  243         }

  244 

  245         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PagingButtonSpacing"]/*'/>

  246         [Browsable(true), Themeable(true), ANPCategory("cat_Navigation"), DefaultValue(typeof(Unit), "5px"), ANPDescription("desc_PagingButtonSpacing")]

  247         public Unit PagingButtonSpacing

  248         {

  249             get

  250             {

  251                 if (null != cloneFrom)

  252                     return cloneFrom.PagingButtonSpacing;

  253                 object obj = ViewState["PagingButtonSpacing"];

  254                 return (obj == null) ? Unit.Pixel(5) : (Unit.Parse(obj.ToString()));

  255             }

  256             set

  257             {

  258                 ViewState["PagingButtonSpacing"] = value;

  259             }

  260         }

  261 

  262         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowFirstLast"]/*'/>

  263         [Browsable(true), Themeable(true), ANPDescription("desc_ShowFirstLast"), ANPCategory("cat_Navigation"), DefaultValue(true)]

  264         public bool ShowFirstLast

  265         {

  266             get

  267             {

  268                 if (null != cloneFrom)

  269                     return cloneFrom.ShowFirstLast;

  270                 object obj = ViewState["ShowFirstLast"];

  271                 return (obj == null) ? true : (bool)obj;

  272             }

  273             set { ViewState["ShowFirstLast"] = value; }

  274         }

  275 

  276         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowPrevNext"]/*'/>

  277         [Browsable(true), Themeable(true), ANPDescription("desc_ShowPrevNext"), ANPCategory("cat_Navigation"), DefaultValue(true)]

  278         public bool ShowPrevNext

  279         {

  280             get

  281             {

  282                 if (null != cloneFrom)

  283                     return cloneFrom.ShowPrevNext;

  284                 object obj = ViewState["ShowPrevNext"];

  285                 return (obj == null) ? true : (bool)obj;

  286             }

  287             set { ViewState["ShowPrevNext"] = value; }

  288         }

  289 

  290         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowPageIndex"]/*'/>

  291         [Browsable(true), Themeable(true), ANPDescription("desc_ShowPageIndex"), ANPCategory("cat_Navigation"), DefaultValue(true)]

  292         public bool ShowPageIndex

  293         {

  294             get

  295             {

  296                 if (null != cloneFrom)

  297                     return cloneFrom.ShowPageIndex;

  298                 object obj = ViewState["ShowPageIndex"];

  299                 return (obj == null) ? true : (bool)obj;

  300             }

  301             set { ViewState["ShowPageIndex"] = value; }

  302         }

  303 

  304         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowMoreButtons"]/*'/>

  305         [Browsable(true), Themeable(true), ANPDescription("desc_ShowMoreButtons"), ANPCategory("cat_Navigation"), DefaultValue(true)]

  306         public bool ShowMoreButtons

  307         {

  308             get

  309             {

  310                 if (null != cloneFrom)

  311                     return cloneFrom.ShowMoreButtons;

  312                 object obj = ViewState["ShowMoreButtons"];

  313                 return (obj == null) ? true : (bool)obj;

  314             }

  315             set { ViewState["ShowMoreButtons"] = value; }

  316         }

  317 

  318         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="FirstPageText"]/*'/>

  319         [Browsable(true), Themeable(true), ANPDescription("desc_FirstPageText"), ANPCategory("cat_Navigation"), DefaultValue("&lt;&lt;")]

  320         public string FirstPageText

  321         {

  322             get

  323             {

  324                 if (null != cloneFrom)

  325                     return cloneFrom.FirstPageText;

  326                 object obj = ViewState["FirstPageText"];

  327                 return (obj == null) ? "&lt;&lt;" : (string)obj;

  328             }

  329             set { ViewState["FirstPageText"] = value; }

  330         }

  331 

  332         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PrevPageText"]/*'/>

  333         [Browsable(true), Themeable(true), ANPDescription("desc_PrevPageText"), ANPCategory("cat_Navigation"), DefaultValue("&lt;")]

  334         public string PrevPageText

  335         {

  336             get

  337             {

  338                 if (null != cloneFrom)

  339                     return cloneFrom.PrevPageText;

  340                 object obj = ViewState["PrevPageText"];

  341                 return (obj == null) ? "&lt;" : (string)obj;

  342             }

  343             set { ViewState["PrevPageText"] = value; }

  344         }

  345 

  346         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NextPageText"]/*'/>

  347         [Browsable(true), Themeable(true), ANPDescription("desc_NextPageText"), ANPCategory("cat_Navigation"), DefaultValue("&gt;")]

  348         public string NextPageText

  349         {

  350             get

  351             {

  352                 if (null != cloneFrom)

  353                     return cloneFrom.NextPageText;

  354                 object obj = ViewState["NextPageText"];

  355                 return (obj == null) ? "&gt;" : (string)obj;

  356             }

  357             set { ViewState["NextPageText"] = value; }

  358         }

  359 

  360         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="LastPageText"]/*'/>

  361         [Browsable(true), Themeable(true), ANPDescription("desc_LastPageText"), ANPCategory("cat_Navigation"), DefaultValue("&gt;&gt;")]

  362         public string LastPageText

  363         {

  364             get

  365             {

  366                 if (null != cloneFrom)

  367                     return cloneFrom.LastPageText;

  368                 object obj = ViewState["LastPageText"];

  369                 return (obj == null) ? "&gt;&gt;" : (string)obj;

  370             }

  371             set { ViewState["LastPageText"] = value; }

  372         }

  373 

  374         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NumericButtonCount"]/*'/>

  375         [Browsable(true), Themeable(true), ANPDescription("desc_NumericButtonCount"), ANPCategory("cat_Navigation"), DefaultValue(10)]

  376         public int NumericButtonCount

  377         {

  378             get

  379             {

  380                 if (null != cloneFrom)

  381                     return cloneFrom.NumericButtonCount;

  382                 object obj = ViewState["NumericButtonCount"];

  383                 return (obj == null) ? 10 : (int)obj;

  384             }

  385             set { ViewState["NumericButtonCount"] = value; }

  386         }

  387 

  388         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowDisabledButtons"]/*'/>

  389         [Browsable(true), Themeable(true), ANPCategory("cat_Navigation"), ANPDescription("desc_ShowDisabledButtons"), DefaultValue(true)]

  390         public bool ShowDisabledButtons

  391         {

  392             get

  393             {

  394                 if (null != cloneFrom)

  395                     return cloneFrom.ShowDisabledButtons;

  396                 object obj = ViewState["ShowDisabledButtons"];

  397                 return (obj == null) ? true : (bool)obj;

  398             }

  399             set

  400             {

  401                 ViewState["ShowDisabledButtons"] = value;

  402             }

  403         }

  404 

  405         #endregion

  406 

  407         #region Image Navigation Buttons

  408 

  409         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ImagePath"]/*'/>

  410         [Browsable(true), Category("Appearance"), ANPDescription("desc_ImagePath"), DefaultValue(null)]

  411         public string ImagePath

  412         {

  413             get

  414             {

  415                 if (null != cloneFrom)

  416                     return cloneFrom.ImagePath;

  417                 string imgPath = (string)ViewState["ImagePath"];

  418                 if (imgPath != null)

  419                     imgPath = ResolveUrl(imgPath);

  420                 return imgPath;

  421             }

  422             set

  423             {

  424                 string imgPath = value.Trim().Replace("\\", "/");

  425                 ViewState["ImagePath"] = (imgPath.EndsWith("/")) ? imgPath : imgPath + "/";

  426             }

  427         }

  428 

  429         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ButtonImageExtension"]/*'/>

  430         [Browsable(true), Themeable(true), Category("Appearance"), DefaultValue(".gif"), ANPDescription("desc_ButtonImageExtension")]

  431         public string ButtonImageExtension

  432         {

  433             get

  434             {

  435                 if (null != cloneFrom)

  436                     return cloneFrom.ButtonImageExtension;

  437                 object obj = ViewState["ButtonImageExtension"];

  438                 return (obj == null) ? ".gif" : (string)obj;

  439             }

  440             set

  441             {

  442                 string ext = value.Trim();

  443                 ViewState["ButtonImageExtension"] = (ext.StartsWith(".")) ? ext : ("." + ext);

  444             }

  445         }

  446 

  447         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ButtonImageNameExtension"]/*'/>

  448         [Browsable(true), Themeable(true), DefaultValue(null), Category("Appearance"), ANPDescription("desc_ButtonImageNameExtension")]

  449         public string ButtonImageNameExtension

  450         {

  451             get

  452             {

  453                 if (null != cloneFrom)

  454                     return cloneFrom.ButtonImageNameExtension;

  455                 object obj = ViewState["ButtonImageNameExtension"];

  456                 return (obj == null) ? null : (string)obj;

  457             }

  458             set

  459             {

  460                 ViewState["ButtonImageNameExtension"] = value;

  461             }

  462         }

  463 

  464         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CpiButtonImageNameExtension"]/*'/>

  465         [Browsable(true), Themeable(true), DefaultValue(null), Category("Appearance"), ANPDescription("desc_CpiButtonImageNameExtension")]

  466         public string CpiButtonImageNameExtension

  467         {

  468             get

  469             {

  470                 if (null != cloneFrom)

  471                     return cloneFrom.CpiButtonImageNameExtension;

  472                 object obj = ViewState["CpiButtonImageNameExtension"];

  473                 return (obj == null) ? ButtonImageNameExtension : (string)obj;

  474             }

  475             set

  476             {

  477                 ViewState["CpiButtonImageNameExtension"] = value;

  478             }

  479         }

  480 

  481         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="DisabledButtonImageNameExtension"]/*'/>

  482         [Browsable(true), Themeable(true), DefaultValue(null), Category("Appearance"), ANPDescription("desc_DisabledButtonImageNameExtension")]

  483         public string DisabledButtonImageNameExtension

  484         {

  485             get

  486             {

  487                 if (null != cloneFrom)

  488                     return cloneFrom.DisabledButtonImageNameExtension;

  489                 object obj = ViewState["DisabledButtonImageNameExtension"];

  490                 return (obj == null) ? ButtonImageNameExtension : (string)obj;

  491             }

  492             set

  493             {

  494                 ViewState["DisabledButtonImageNameExtension"] = value;

  495             }

  496         }

  497 

  498         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ButtonImageAlign"]/*'/>

  499         [Browsable(true), ANPDescription("desc_ButtonImageAlign"), DefaultValue(ImageAlign.NotSet), Category("Appearance")]

  500         public ImageAlign ButtonImageAlign

  501         {

  502             get

  503             {

  504                 if (null != cloneFrom)

  505                     return cloneFrom.ButtonImageAlign;

  506                 object obj = ViewState["ButtonImageAlign"];

  507                 return (obj == null) ? ImageAlign.NotSet : (ImageAlign)obj;

  508             }

  509             set

  510             {

  511                 if (value != ImageAlign.Right && value != ImageAlign.Left)

  512                     ViewState["ButtonImageAlign"] = value;

  513             }

  514         }

  515 

  516 

  517         #endregion

  518 

  519         #region Paging

  520 

  521         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="UrlPaging"]/*'/>

  522         [Browsable(true), ANPCategory("cat_Paging"), DefaultValue(false), ANPDescription("desc_UrlPaging")]

  523         public bool UrlPaging

  524         {

  525             get

  526             {

  527                 if (null != cloneFrom)

  528                     return cloneFrom.UrlPaging;

  529                 object obj = ViewState["UrlPaging"];

  530                 return (null == obj) ? false : (bool)obj;

  531             }

  532             set

  533             {

  534                 ViewState["UrlPaging"] = value;

  535             }

  536         }

  537 

  538         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="UrlPageIndexName"]/*'/>

  539         [Browsable(true), DefaultValue("page"), ANPCategory("cat_Paging"), ANPDescription("desc_UrlPageIndexName")]

  540         public string UrlPageIndexName

  541         {

  542             get

  543             {

  544                 if (null != cloneFrom)

  545                     return cloneFrom.UrlPageIndexName;

  546                 object obj = ViewState["UrlPageIndexName"];

  547                 return (null == obj) ? "page" : (string)obj;

  548             }

  549             set { ViewState["UrlPageIndexName"] = value; }

  550         }

  551 

  552         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="UrlPageSizeName"]/*'/>

  553         [Browsable(true), DefaultValue(""), ANPCategory("cat_Paging"), ANPDescription("desc_UrlPageSizeName")]

  554         public string UrlPageSizeName

  555         {

  556             get

  557             {

  558                 if (null != cloneFrom)

  559                     return cloneFrom.UrlPageSizeName;

  560                 return (string)ViewState["UrlPageSizeName"];

  561             }

  562             set { ViewState["UrlPageSizeName"] = value; }

  563         }

  564 

  565         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ReverseUrlPageIndex"]/*'/>

  566         [Browsable(true), DefaultValue(false), ANPCategory("cat_Paging"), ANPDescription("desc_ReverseUrlPageIndex")]

  567         public bool ReverseUrlPageIndex

  568         {

  569             get

  570             {

  571                 if (null != cloneFrom)

  572                     return cloneFrom.ReverseUrlPageIndex;

  573                 object obj = ViewState["ReverseUrlPageIndex"];

  574                 return (null == obj) ? false : (bool)obj;

  575             }

  576             set { ViewState["ReverseUrlPageIndex"] = value; }

  577         }

  578 

  579 

  580         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CurrentPageIndex"]/*'/>

  581         [Browsable(true), ANPDescription("desc_CurrentPageIndex"), ANPCategory("cat_Paging"), DefaultValue(1)]

  582         public int CurrentPageIndex

  583         {

  584             get

  585             {

  586                 if (null != cloneFrom)

  587                     return cloneFrom.CurrentPageIndex;

  588                 object cpage = ViewState["CurrentPageIndex"];

  589                 int pindex = (cpage == null) ? 1 : (int)cpage;

  590                 if (pindex > PageCount && PageCount > 0)

  591                     return PageCount;

  592                 if (pindex < 1)

  593                     return 1;

  594                 return pindex;

  595             }

  596             set

  597             {

  598                 int cpage = value;

  599                 if (cpage < 1)

  600                     cpage = 1;

  601                 else if (cpage > PageCount)

  602                     cpage = PageCount;

  603                 ViewState["CurrentPageIndex"] = cpage;

  604                 //if(!pageChangeEventHandled)

  605                 //{

  606                 //    OnPageChanging(new PageChangingEventArgs(cpage));

  607                 //}

  608             }

  609         }

  610 

  611         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="RecordCount"]/*'/>

  612         [Browsable(false), ANPDescription("desc_RecordCount"), Category("Data"), DefaultValue(0)]

  613         public int RecordCount

  614         {

  615             get

  616             {

  617                 if (null != cloneFrom)

  618                     return cloneFrom.RecordCount;

  619                 object obj = ViewState["Recordcount"];

  620                 return (obj == null) ? 0 : (int)obj;

  621             }

  622             set { ViewState["Recordcount"] = value; }

  623         }

  624 

  625         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PagesRemain"]/*'/>

  626         [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

  627         public int PagesRemain

  628         {

  629             get

  630             {

  631                 return PageCount - CurrentPageIndex;

  632             }

  633         }

  634 

  635         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PageSize"]/*'/>

  636         [Browsable(true), ANPDescription("desc_PageSize"), ANPCategory("cat_Paging"), DefaultValue(10)]

  637         public int PageSize

  638         {

  639             get

  640             {

  641                 if (!string.IsNullOrEmpty(UrlPageSizeName) && !DesignMode)

  642                 {

  643                     int pageSize;

  644                     if (int.TryParse(Page.Request.QueryString[UrlPageSizeName], out pageSize))

  645                     {

  646                         if (pageSize > 0)

  647                             return pageSize;

  648                     }

  649                 }

  650                 if (null != cloneFrom)

  651                     return cloneFrom.PageSize;

  652                 object obj = ViewState["PageSize"];

  653                 return (obj == null) ? 10 : (int)obj;

  654             }

  655             set

  656             {

  657                 ViewState["PageSize"] = value;

  658             }

  659         }

  660 

  661         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="RecordsRemain"]/*'/>

  662         [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

  663         public int RecordsRemain

  664         {

  665             get

  666             {

  667                 if (CurrentPageIndex < PageCount)

  668                     return RecordCount - (CurrentPageIndex * PageSize);

  669                 return 0;

  670             }

  671         }

  672 

  673         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="StartRecordIndex"]/*'/>

  674         [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

  675         public int StartRecordIndex

  676         {

  677             get

  678             {

  679                 //if (FillLastPage && RecordCount > PageSize && CurrentPageIndex == PageCount)

  680                 //    return RecordCount - PageSize;

  681                 return (CurrentPageIndex - 1) * PageSize + 1;

  682             }

  683         }

  684 

  685 

  686         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="EndRecordIndex"]/*'/>

  687         [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

  688         public int EndRecordIndex

  689         {

  690             get

  691             {

  692                 return RecordCount - RecordsRemain;

  693             }

  694         }

  695 

  696         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PageCount"]/*'/>

  697         [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

  698         public int PageCount

  699         {

  700             get

  701             {

  702                 if (RecordCount == 0)

  703                     return 1;

  704                 return (int)Math.Ceiling((double)RecordCount / (double)PageSize);

  705             }

  706         }

  707 

  708 

  709         #endregion

  710 

  711         #region Page index box

  712 

  713 

  714         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowPageIndexBox"]/*'/>

  715         [Browsable(true), ANPCategory("cat_PageIndexBox"), DefaultValue(null), ANPDescription("desc_ShowPageIndexBox")]

  716         public ShowPageIndexBox ShowPageIndexBox

  717         {

  718             get

  719             {

  720                 if (null != cloneFrom)

  721                     return cloneFrom.ShowPageIndexBox;

  722                 object obj = ViewState["ShowPageIndexBox"];

  723                 return (obj == null) ? ShowPageIndexBox.Auto : (ShowPageIndexBox)obj;

  724             }

  725             set { ViewState["ShowPageIndexBox"] = value; }

  726         }

  727 

  728         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PageIndexBoxType"]/*'/>

  729         [Browsable(true), ANPCategory("cat_PageIndexBox"), DefaultValue(null), ANPDescription("desc_PageIndexBoxType")]

  730         public PageIndexBoxType PageIndexBoxType

  731         {

  732             get

  733             {

  734                 if (null != cloneFrom)

  735                     return cloneFrom.PageIndexBoxType;

  736                 object obj = ViewState["PageIndexBoxType"];

  737                 return (obj == null) ? PageIndexBoxType.TextBox : (PageIndexBoxType)obj;

  738             }

  739             set

  740             {

  741                 ViewState["PageIndexBoxType"] = value;

  742             }

  743         }

  744 

  745 

  746         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PageIndexBoxClass"]/*'/>

  747         [Browsable(true), ANPCategory("cat_PageIndexBox"), DefaultValue(null), ANPDescription("desc_PageIndexBoxClasss")]

  748         public string PageIndexBoxClass

  749         {

  750             get

  751             {

  752                 if (null != cloneFrom)

  753                     return cloneFrom.PageIndexBoxClass;

  754                 object obj = ViewState["PageIndexBoxClass"];

  755                 return (obj == null) ? null : (string)obj;

  756             }

  757             set

  758             {

  759                 if (value.Trim().Length > 0)

  760                     ViewState["PageIndexBoxClass"] = value;

  761             }

  762         }

  763 

  764 

  765         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PageIndexBoxStyle"]/*'/>

  766         [Browsable(true), ANPCategory("cat_PageIndexBox"), DefaultValue(null), ANPDescription("desc_PageIndexBoxStyle")]

  767         public string PageIndexBoxStyle

  768         {

  769             get

  770             {

  771                 if (null != cloneFrom)

  772                     return cloneFrom.PageIndexBoxStyle;

  773                 object obj = ViewState["PageIndexBoxStyle"];

  774                 return (obj == null) ? null : (string)obj;

  775             }

  776             set

  777             {

  778                 if (value.Trim().Length > 0)

  779                     ViewState["PageIndexBoxStyle"] = value;

  780             }

  781         }

  782 

  783 

  784         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="TextBeforePageIndexBox"]/*'/>

  785         [Browsable(true), Themeable(true), ANPCategory("cat_PageIndexBox"), DefaultValue(null), ANPDescription("desc_TextBeforePageIndexBox")]

  786         public string TextBeforePageIndexBox

  787         {

  788             get

  789             {

  790                 if (null != cloneFrom)

  791                     return cloneFrom.TextBeforePageIndexBox;

  792                 object obj = ViewState["TextBeforePageIndexBox"];

  793                 return (null == obj) ? null : (string)obj;

  794             }

  795             set

  796             {

  797                 ViewState["TextBeforePageIndexBox"] = value;

  798             }

  799         }

  800 

  801 

  802         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="TextAfterPageIndexBox"]/*'/>

  803         [Browsable(true), Themeable(true), DefaultValue(null), ANPCategory("cat_PageIndexBox"), ANPDescription("desc_TextAfterPageIndexBox")]

  804         public string TextAfterPageIndexBox

  805         {

  806             get

  807             {

  808                 if (null != cloneFrom)

  809                     return cloneFrom.TextAfterPageIndexBox;

  810                 object obj = ViewState["TextAfterPageIndexBox"];

  811                 return (null == obj) ? null : (string)obj;

  812             }

  813             set

  814             {

  815                 ViewState["TextAfterPageIndexBox"] = value;

  816             }

  817         }

  818 

  819         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="SubmitButtonText"]/*'/>

  820         [Browsable(true), Themeable(true), ANPCategory("cat_PageIndexBox"), DefaultValue("go"), ANPDescription("desc_SubmitButtonText")]

  821         public string SubmitButtonText

  822         {

  823             get

  824             {

  825                 if (null != cloneFrom)

  826                     return cloneFrom.SubmitButtonText;

  827                 object obj = ViewState["SubmitButtonText"];

  828                 return (null == obj) ? "go" : (string)obj;

  829             }

  830             set

  831             {

  832                 if (null == value)

  833                     value = "go";

  834                 ViewState["SubmitButtonText"] = value;

  835             }

  836         }

  837 

  838         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="SubmitButtonClass"]/*'/>

  839         [Browsable(true), ANPCategory("cat_PageIndexBox"), DefaultValue(null), ANPDescription("desc_SubmitButtonClass")]

  840         public string SubmitButtonClass

  841         {

  842             get

  843             {

  844                 if (null != cloneFrom)

  845                     return cloneFrom.SubmitButtonClass;

  846                 return (string)ViewState["SubmitButtonClass"];

  847             }

  848             set

  849             {

  850                 ViewState["SubmitButtonClass"] = value;

  851             }

  852         }

  853 

  854         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="SubmitButtonStyle"]/*'/>

  855         [Browsable(true), ANPCategory("cat_PageIndexBox"), DefaultValue(null), ANPDescription("desc_SubmitButtonStyle")]

  856         public string SubmitButtonStyle

  857         {

  858             get

  859             {

  860                 if (null != cloneFrom)

  861                     return cloneFrom.SubmitButtonStyle;

  862                 return (string)ViewState["SubmitButtonStyle"];

  863             }

  864             set

  865             {

  866                 ViewState["SubmitButtonStyle"] = value;

  867             }

  868         }

  869 

  870         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="SubmitButtonImageUrl"]/*'/>

  871         [Browsable(true), DefaultValue(""), Category("Appearance"), ANPDescription("desc_SubmitButtonImageUrl")]

  872         public string SubmitButtonImageUrl

  873         {

  874             get

  875             {

  876                 if (null != cloneFrom)

  877                     return cloneFrom.SubmitButtonImageUrl;

  878                 return (string)ViewState["SubmitButtonImageUrl"];

  879             }

  880             set { ViewState["SubmitButtonImageUrl"] = value; }

  881         }

  882 

  883         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowBoxThreshold"]/*'/>

  884         [Browsable(true), Themeable(true), ANPDescription("desc_ShowBoxThreshold"), ANPCategory("cat_PageIndexBox"), DefaultValue(30)]

  885         public int ShowBoxThreshold

  886         {

  887             get

  888             {

  889                 if (null != cloneFrom)

  890                     return cloneFrom.ShowBoxThreshold;

  891                 object obj = ViewState["ShowBoxThreshold"];

  892                 return (null == obj) ? 30 : (int)obj;

  893             }

  894             set { ViewState["ShowBoxThreshold"] = value; }

  895         }

  896 

  897 

  898         #endregion

  899 

  900         #region CustomInfoSection

  901 

  902         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowCustomInfoSection"]/*'/>

  903         [Browsable(true), Themeable(true), ANPDescription("desc_ShowCustomInfoSection"), DefaultValue(ShowCustomInfoSection.Never), Category("Appearance")]

  904         public ShowCustomInfoSection ShowCustomInfoSection

  905         {

  906             get

  907             {

  908                 if (null != cloneFrom)

  909                     return cloneFrom.ShowCustomInfoSection;

  910                 object obj = ViewState["ShowCustomInfoSection"];

  911                 return (null == obj) ? ShowCustomInfoSection.Never : (ShowCustomInfoSection)obj;

  912             }

  913             set { ViewState["ShowCustomInfoSection"] = value; }

  914         }

  915 

  916         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CustomInfoTextAlign"]/*'/>

  917         [Browsable(true), Category("Appearance"), DefaultValue(HorizontalAlign.NotSet), ANPDescription("desc_CustomInfoTextAlign")]

  918         public HorizontalAlign CustomInfoTextAlign

  919         {

  920             get

  921             {

  922                 if (null != cloneFrom)

  923                     return cloneFrom.CustomInfoTextAlign;

  924                 object obj = ViewState["CustomInfoTextAlign"];

  925                 return (null == obj) ? HorizontalAlign.NotSet : (HorizontalAlign)obj;

  926             }

  927             set

  928             {

  929                 ViewState["CustomInfoTextAlign"] = value;

  930             }

  931         }

  932 

  933         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CustomInfoSectionWidth"]/*'/>

  934         [Browsable(true), Category("Appearance"), DefaultValue(typeof(Unit), "40%"), ANPDescription("desc_CustomInfoSectionWidth")]

  935         public Unit CustomInfoSectionWidth

  936         {

  937             get

  938             {

  939                 if (null != cloneFrom)

  940                     return cloneFrom.CustomInfoSectionWidth;

  941                 object obj = ViewState["CustomInfoSectionWidth"];

  942                 return (null == obj) ? Unit.Percentage(40) : (Unit)obj;

  943             }

  944             set

  945             {

  946                 ViewState["CustomInfoSectionWidth"] = value;

  947             }

  948         }

  949 

  950         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CustomInfoClass"]/*'/>

  951         [Browsable(true), Category("Appearance"), DefaultValue(null), ANPDescription("desc_CustomInfoClass")]

  952         public string CustomInfoClass

  953         {

  954             get

  955             {

  956                 if (null != cloneFrom)

  957                     return cloneFrom.CustomInfoClass;

  958                 object obj = ViewState["CustomInfoClass"];

  959                 return (null == obj) ? CssClass : (string)obj;

  960             }

  961             set

  962             {

  963                 ViewState["CustomInfoClass"] = value;

  964             }

  965         }

  966 

  967         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CustomInfoStyle"]/*'/>

  968         [Browsable(true), Category("Appearance"), DefaultValue(null), ANPDescription("desc_CustomInfoStyle")]

  969         public string CustomInfoStyle

  970         {

  971             get

  972             {

  973                 if (null != cloneFrom)

  974                     return cloneFrom.CustomInfoStyle;

  975                 object obj = ViewState["CustomInfoStyle"];

  976                 return (null == obj) ? Style.Value : (string)obj;

  977             }

  978             set

  979             {

  980                 ViewState["CustomInfoStyle"] = value;

  981             }

  982         }

  983 

  984         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CustomInfoHTML"]/*'/>

  985         [Browsable(true), Themeable(true), Category("Appearance"), DefaultValue("Page %CurrentPageIndex% of %PageCount%"), ANPDescription("desc_CustomInfoHTML")]

  986         public string CustomInfoHTML

  987         {

  988             get

  989             {

  990                 if (null != cloneFrom)

  991                     return cloneFrom.CustomInfoHTML;

  992                 object obj = ViewState["CustomInfoText"];

  993                 return (null == obj) ? "Page %CurrentPageIndex% of %PageCount%" : (string)obj;

  994             }

  995             set

  996             {

  997                 ViewState["CustomInfoText"] = value;

  998             }

  999         }

 1000 

 1001         #endregion

 1002 

 1003         #region Css class and styles

 1004 

 1005 

 1006         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CurrentPageButtonStyle"]/*'/>

 1007         [Browsable(true), Category("Appearance"), ANPDescription("desc_CurrentPageButtonStyle"), DefaultValue(null)]

 1008         public string CurrentPageButtonStyle

 1009         {

 1010             get

 1011             {

 1012                 if (null != cloneFrom)

 1013                     return cloneFrom.CurrentPageButtonStyle;

 1014                 object obj = ViewState["CPBStyle"];

 1015                 return (null == obj) ? null : (string)obj;

 1016             }

 1017             set

 1018             {

 1019                 ViewState["CPBStyle"] = value;

 1020             }

 1021         }

 1022 

 1023         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CurrentPageButtonClass"]/*'/>

 1024         [Browsable(true), Category("Appearance"), ANPDescription("desc_CurrentPageButtonClass"), DefaultValue(null)]

 1025         public string CurrentPageButtonClass

 1026         {

 1027             get

 1028             {

 1029                 if (null != cloneFrom)

 1030                     return cloneFrom.CurrentPageButtonClass;

 1031                 object obj = ViewState["CPBClass"];

 1032                 return (null == obj) ? null : (string)obj;

 1033             }

 1034             set

 1035             {

 1036                 ViewState["CPBClass"] = value;

 1037             }

 1038         }

 1039 

 1040 

 1041         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PagingButtonsClass"]/*'/>

 1042         [Browsable(true), Category("Appearance"), Themeable(true), ANPDescription("desc_PagingButtonClass"), DefaultValue(null)]

 1043         public string PagingButtonsClass

 1044         {

 1045             get

 1046             {

 1047                 if (null != cloneFrom)

 1048                     return cloneFrom.PagingButtonsClass;

 1049                 object obj = ViewState["PagingButtonsClass"];

 1050                 return (null == obj) ? null : (string)obj;

 1051             }

 1052             set

 1053             {

 1054                 ViewState["PagingButtonsClass"] = value;

 1055             }

 1056         }

 1057 

 1058         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PagingButtonsStyle"]/*'/>

 1059         [Browsable(true), Category("Appearance"), Themeable(true), ANPDescription("desc_PagingButtonStyle"), DefaultValue(null)]

 1060         public string PagingButtonsStyle

 1061         {

 1062             get

 1063             {

 1064                 if (null != cloneFrom)

 1065                     return cloneFrom.PagingButtonsStyle;

 1066                 object obj = ViewState["PagingButtonsStyle"];

 1067                 return (null == obj) ? null : (string)obj;

 1068             }

 1069             set

 1070             {

 1071                 ViewState["PagingButtonsStyle"] = value;

 1072             }

 1073         }

 1074 

 1075         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="FirstLastButtonsClass"]/*'/>

 1076         [Browsable(true), Category("Appearance"), Themeable(true), ANPDescription("desc_FirstLastButtonsClass"), DefaultValue(null)]

 1077         public string FirstLastButtonsClass

 1078         {

 1079             get

 1080             {

 1081                 if (null != cloneFrom)

 1082                     return cloneFrom.FirstLastButtonsClass;

 1083                 object obj = ViewState["FirstLastButtonsClass"];

 1084                 return (null == obj) ? PagingButtonsClass : (string)obj;

 1085             }

 1086             set

 1087             {

 1088                 ViewState["FirstLastButtonsClass"] = value;

 1089             }

 1090         }

 1091 

 1092         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="FirstLastButtonsStyle"]/*'/>

 1093         [Browsable(true), Category("Appearance"), Themeable(true), ANPDescription("desc_FirstLastButtonsStyle"), DefaultValue(null)]

 1094         public string FirstLastButtonsStyle

 1095         {

 1096             get

 1097             {

 1098                 if (null != cloneFrom)

 1099                     return cloneFrom.FirstLastButtonsStyle;

 1100                 object obj = ViewState["FirstLastButtonsStyle"];

 1101                 return (null == obj) ? PagingButtonsStyle : (string)obj;

 1102             }

 1103             set

 1104             {

 1105                 ViewState["FirstLastButtonsStyle"] = value;

 1106             }

 1107         }

 1108 

 1109         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PrevNextButtonsClass"]/*'/>

 1110         [Browsable(true), Category("Appearance"), Themeable(true), ANPDescription("desc_PrevNextButtonsClass"), DefaultValue(null)]

 1111         public string PrevNextButtonsClass

 1112         {

 1113             get

 1114             {

 1115                 if (null != cloneFrom)

 1116                     return cloneFrom.PrevNextButtonsClass;

 1117                 object obj = ViewState["PrevNextButtonsClass"];

 1118                 return (null == obj) ? PagingButtonsClass : (string)obj;

 1119             }

 1120             set

 1121             {

 1122                 ViewState["PrevNextButtonsClass"] = value;

 1123             }

 1124         }

 1125 

 1126         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PrevNextButtonsStyle"]/*'/>

 1127         [Browsable(true), Category("Appearance"), Themeable(true), ANPDescription("desc_PrevNextButtonsStyle"), DefaultValue(null)]

 1128         public string PrevNextButtonsStyle

 1129         {

 1130             get

 1131             {

 1132                 if (null != cloneFrom)

 1133                     return cloneFrom.PrevNextButtonsStyle;

 1134                 object obj = ViewState["PrevNextButtonsStyle"];

 1135                 return (null == obj) ? PagingButtonsStyle : (string)obj;

 1136             }

 1137             set

 1138             {

 1139                 ViewState["PrevNextButtonsStyle"] = value;

 1140             }

 1141         }

 1142 

 1143         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="MoreButtonsClass"]/*'/>

 1144         [Browsable(true), Category("Appearance"), Themeable(true), ANPDescription("desc_MoreButtonsClass"), DefaultValue(null)]

 1145         public string MoreButtonsClass

 1146         {

 1147             get

 1148             {

 1149                 if (null != cloneFrom)

 1150                     return cloneFrom.MoreButtonsClass;

 1151                 object obj = ViewState["MoreButtonsClass"];

 1152                 return (null == obj) ? PagingButtonsClass : (string)obj;

 1153             }

 1154             set

 1155             {

 1156                 ViewState["MoreButtonsClass"] = value;

 1157             }

 1158         }

 1159 

 1160         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="MoreButtonsStyle"]/*'/>

 1161         [Browsable(true), Category("Appearance"), Themeable(true), ANPDescription("desc_MoreButtonsStyle"), DefaultValue(null)]

 1162         public string MoreButtonsStyle

 1163         {

 1164             get

 1165             {

 1166                 if (null != cloneFrom)

 1167                     return cloneFrom.MoreButtonsStyle;

 1168                 object obj = ViewState["MoreButtonsStyle"];

 1169                 return (null == obj) ? PagingButtonsStyle : (string)obj;

 1170             }

 1171             set

 1172             {

 1173                 ViewState["MoreButtonsStyle"] = value;

 1174             }

 1175         }

 1176 

 1177         /*

 1178         public string DisabledButtonsClass

 1179         {

 1180             get

 1181             {

 1182                 if (null != cloneFrom)

 1183                     return cloneFrom.DisabledButtonsClass;

 1184                 object obj = ViewState["DisabledButtonsClass"];

 1185                 return (null == obj) ? DisabledButtonsClass : (string)obj;

 1186             }

 1187             set

 1188             {

 1189                 ViewState["DisabledButtonsClass"] = value;

 1190             }

 1191         }

 1192 

 1193 

 1194         public string DisabledButtonsStyle

 1195         {

 1196             get

 1197             {

 1198                 if (null != cloneFrom)

 1199                     return cloneFrom.DisabledButtonsStyle;

 1200                 object obj = ViewState["DisabledButtonsStyle"];

 1201                 return (null == obj) ? DisabledButtonsStyle : (string)obj;

 1202             }

 1203             set

 1204             {

 1205                 ViewState["DisabledButtonsStyle"] = value;

 1206             }

 1207         }

 1208          */

 1209         #endregion

 1210 

 1211         #region Others

 1212 

 1213         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="CloneFrom"]/*'/>

 1214         [Browsable(true), Themeable(false), TypeConverter(typeof(AspNetPagerIDConverter)), Category("Behavior"), DefaultValue(false), ANPDescription("desc_CloneFrom")]

 1215         public string CloneFrom

 1216         {

 1217             get

 1218             {

 1219                 return (string)ViewState["CloneFrom"];

 1220             }

 1221             set

 1222             {

 1223                 if (null != value && String.Empty == value.Trim())

 1224                     throw new ArgumentNullException("CloneFrom", "The Value of property CloneFrom can not be empty string!");

 1225                 if (ID.Equals(value, StringComparison.OrdinalIgnoreCase))

 1226                     throw new ArgumentException("The property value of CloneFrom can not be set to control itself!", "CloneFrom");

 1227                 ViewState["CloneFrom"] = value;

 1228             }

 1229         }

 1230 

 1231         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="EnableTheming"]/*'/>

 1232         public override bool EnableTheming

 1233         {

 1234             get

 1235             {

 1236                 if (null != cloneFrom)

 1237                     return cloneFrom.EnableTheming;

 1238                 return base.EnableTheming;

 1239             }

 1240             set

 1241             {

 1242                 base.EnableTheming = value;

 1243             }

 1244         }

 1245 

 1246         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="SkinID"]/*'/>

 1247         public override string SkinID

 1248         {

 1249             get

 1250             {

 1251                 if (null != cloneFrom)

 1252                     return cloneFrom.SkinID;

 1253                 return base.SkinID;

 1254             }

 1255             set

 1256             {

 1257                 base.SkinID = value;

 1258             }

 1259         }

 1260 

 1261         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="EnableUrlRewriting"]/*'/>

 1262         [Browsable(true), Themeable(true), Category("Behavior"), DefaultValue(false), ANPDescription("desc_EnableUrlWriting")]

 1263         public bool EnableUrlRewriting

 1264         {

 1265             get

 1266             {

 1267                 object obj = ViewState["UrlRewriting"];

 1268                 if (null == obj)

 1269                 {

 1270                     if (null != cloneFrom)

 1271                         return cloneFrom.EnableUrlRewriting;

 1272                     return false;

 1273                 }

 1274                 return (bool)obj;

 1275             }

 1276             set

 1277             {

 1278                 ViewState["UrlRewriting"] = value;

 1279                 if (value)

 1280                     UrlPaging = true;

 1281             }

 1282         }

 1283 

 1284         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="UrlRewritePattern"]/*'/>

 1285         [Browsable(true), Themeable(true), Category("Behavior"), DefaultValue(null), ANPDescription("desc_UrlRewritePattern")]

 1286         public string UrlRewritePattern

 1287         {

 1288             get

 1289             {

 1290                 object obj = ViewState["URPattern"];

 1291                 if (null == obj)

 1292                 {

 1293                     if (null != cloneFrom)

 1294                         return cloneFrom.UrlRewritePattern;

 1295                     if (EnableUrlRewriting)

 1296                     {

 1297                         if (!DesignMode)

 1298                         {

 1299                             string filePath = Page.Request.FilePath;

 1300                             return Path.GetFileNameWithoutExtension(filePath) + "_{0}" + Path.GetExtension(filePath);

 1301                         }

 1302                     }

 1303                     return null;

 1304                 }

 1305                 return (string)obj;

 1306             }

 1307             set

 1308             {

 1309                 ViewState["URPattern"] = value;

 1310             }

 1311         }

 1312 

 1313         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="AlwaysShow"]/*'/>

 1314         [Browsable(true), Themeable(true), Category("Behavior"), DefaultValue(false), ANPDescription("desc_AlwaysShow")]

 1315         public bool AlwaysShow

 1316         {

 1317             get

 1318             {

 1319                 object obj = ViewState["AlwaysShow"];

 1320                 if (null == obj)

 1321                 {

 1322                     if (null != cloneFrom)

 1323                         return cloneFrom.AlwaysShow;

 1324                     return false;

 1325                 }

 1326                 return (bool)obj;

 1327             }

 1328             set

 1329             {

 1330                 ViewState["AlwaysShow"] = value;

 1331             }

 1332         }

 1333 

 1334         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="AlwaysShowFirstLastPageNumber"]/*'/>

 1335         [Browsable(true), Themeable(true), Category("Behavior"), DefaultValue(false), ANPDescription("desc_AlwaysShowFirstLastPageNumber")]

 1336         public bool AlwaysShowFirstLastPageNumber

 1337         {

 1338             get

 1339             {

 1340                 object obj = ViewState["AlwaysShowFirstLastPageNumber"];

 1341                 if (null == obj)

 1342                 {

 1343                     if (null != cloneFrom)

 1344                         return cloneFrom.AlwaysShowFirstLastPageNumber;

 1345                     return false;

 1346                 }

 1347                 return (bool)obj;

 1348             }

 1349             set

 1350             {

 1351                 ViewState["AlwaysShowFirstLastPageNumber"] = value;

 1352             }

 1353         }

 1354 

 1355         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="Wrap"]/*'/>

 1356         public override bool Wrap

 1357         {

 1358             get

 1359             {

 1360                 return base.Wrap;

 1361             }

 1362             set

 1363             {

 1364                 base.Wrap = false;

 1365             }

 1366         }

 1367 

 1368         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PageIndexOutOfRangeErrorMessage"]/*'/>

 1369         [Browsable(true), Themeable(true), ANPDescription("desc_PIOutOfRangeMsg"), ANPDefaultValue("def_PIOutOfRangerMsg"), Category("Data")]

 1370         public string PageIndexOutOfRangeErrorMessage

 1371         {

 1372             get

 1373             {

 1374                 object obj = ViewState["PIOutOfRangeErrorMsg"];

 1375                 if (null == obj)

 1376                 {

 1377                     if (null != cloneFrom)

 1378                         return cloneFrom.PageIndexOutOfRangeErrorMessage;

 1379                     return SR.GetString("def_PIOutOfRangerMsg");

 1380                 }

 1381                 return (string)obj;

 1382             }

 1383             set

 1384             {

 1385                 ViewState["PIOutOfRangeErrorMsg"] = value;

 1386             }

 1387         }

 1388 

 1389         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="InvalidPageIndexErrorMessage"]/*'/>

 1390         [Browsable(true), Themeable(true), ANPDescription("desc_InvalidPIErrorMsg"), ANPDefaultValue("def_InvalidPIErrorMsg"), Category("Data")]

 1391         public string InvalidPageIndexErrorMessage

 1392         {

 1393             get

 1394             {

 1395                 object obj = ViewState["InvalidPIErrorMsg"];

 1396                 if (null == obj)

 1397                 {

 1398                     if (null != cloneFrom)

 1399                         return cloneFrom.InvalidPageIndexErrorMessage;

 1400                     return SR.GetString("def_InvalidPIErrorMsg");

 1401                 }

 1402                 return (string)obj;

 1403             }

 1404             set

 1405             {

 1406                 ViewState["InvalidPIErrorMsg"] = value;

 1407             }

 1408         }

 1409 

 1410 

 1411         /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="LayoutType"]/*'/>

 1412         [Browsable(true), Themeable(true), ANPDescription("desc_LayoutType"), ANPDefaultValue("Div"), Category("Appearance")]

 1413         public LayoutType LayoutType

 1414         {

 1415             get

 1416             {

 1417                 if (null != cloneFrom)

 1418                     return cloneFrom.LayoutType;

 1419                 object obj = ViewState["LayoutType"];

 1420                 return (null == obj) ? LayoutType.Div : (LayoutType)obj;

 1421             }

 1422             set { ViewState["LayoutType"] = value; }

 1423         }

 1424 

 1425         #endregion

 1426     }

 1427 }