#region Variables and Constants public event EventHandler ChangePageClick; private string _BarBackGroudColor='#F1F1F1'; private string _BarLinkColor='Navy'; private string _BarCurrentColor='#EEEEEE'; private int _TotalRecord=0; private int _TotalPage=0; private int _CurrentPageIndex=1; private int _ItemSize=10; #endregion
#region Properties
[Description('分页条背景色'),Bindable(true),Category('Appearance'),DefaultValue('#F1F1F1')] public string BarBackGroundColor { get{return _BarBackGroundColor;} set{_BarBackGroundColor=value;} }
[Description('分页条带链接数字颜色'),Bindable(true),Category('Appearance'),DefaultValue('Navy')] public string BarLinkColor { get{return _BarLinkColor;} set{_BarLinkColor=value;} }[Description('分页条当前页数字颜色'),Bindable(true),Category('Appearance'),DefaultValue('#EEEEEE')] public string BarCurrentColor { get{return _BarCurrentColor;} set{_BarCurrentColor=value;} } [Description('总记录数'),Bindable(false),Category('Behavior'),DefaultValue(0)] public int TotalRecord { get{return _TotalRecord;} set { foreach(char c in System.Convert.ToString(value)) { if(!Char.IsNumber(c) { _TotalRecord=0; break; } _TotalRecord=value; } } [Description('每页显示记录数'),Bindable(true),Category('Behavior'),DefaultValue(0)] public int PageSize { get{return _PageSize;} set { foreach(char c in System.Convert.ToString(value)) { if(!Char.IsNumber(c)) { _PageSize=0; break; } } _PageSize=value; } }[Description('总页数'),Bindable(true),Category('Behavior'),DefaultValue(0)] public int TotalPage { get{return _TotalPage;} }[Description('数字规格'),Bindable(true),Category('Behavior'),DefaultValue(10)] public int ItemSize { get{return _ItemSize;} set { foreach(char c in System.Convert.ToString(value)) { if(!Char.IsNumber(c)) { _ItemSize=10; break; } } _ItemSize=value; } }[Description('当前页值'),Bindable(true),Category('Behavior'),DefaultValue(1)] public int CurrentPageIndex { get{return _CurrentPageIndex;} set{_CurrentPageIndex=value;} } #endregion