You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.2 KiB
99 lines
2.2 KiB
2 years ago
|
using System;
|
||
|
using System.Runtime.Serialization;
|
||
|
using System.Xml.Serialization;
|
||
|
|
||
|
namespace Znyc.Admin.Commons.Pages
|
||
|
{
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <param name="info"></param>
|
||
|
public delegate void PageInfoChanged(PagerInfo info);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 分页实体
|
||
|
/// </summary>
|
||
|
[Serializable]
|
||
|
[DataContract]
|
||
|
public class PagerInfo
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 页面选择事件
|
||
|
/// </summary>
|
||
|
public event PageInfoChanged OnPageInfoChanged;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 当前页码
|
||
|
/// </summary>
|
||
|
private int currenetPageIndex;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 每页显示的记录
|
||
|
/// </summary>
|
||
|
private int pageSize;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 记录总数
|
||
|
/// </summary>
|
||
|
private int recordCount;
|
||
|
|
||
|
#region 属性变量
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取或设置当前页码
|
||
|
/// </summary>
|
||
|
[XmlElement(ElementName = "CurrenetPageIndex")]
|
||
|
[DataMember]
|
||
|
public int CurrenetPageIndex
|
||
|
{
|
||
|
get => currenetPageIndex;
|
||
|
set
|
||
|
{
|
||
|
currenetPageIndex = value;
|
||
|
|
||
|
if (OnPageInfoChanged != null)
|
||
|
{
|
||
|
OnPageInfoChanged(this);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取或设置每页显示的记录
|
||
|
/// </summary>
|
||
|
[XmlElement(ElementName = "PageSize")]
|
||
|
[DataMember]
|
||
|
public int PageSize
|
||
|
{
|
||
|
get => pageSize;
|
||
|
set
|
||
|
{
|
||
|
pageSize = value;
|
||
|
if (OnPageInfoChanged != null)
|
||
|
{
|
||
|
OnPageInfoChanged(this);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取或设置记录总数
|
||
|
/// </summary>
|
||
|
[XmlElement(ElementName = "RecordCount")]
|
||
|
[DataMember]
|
||
|
public int RecordCount
|
||
|
{
|
||
|
get => recordCount;
|
||
|
set
|
||
|
{
|
||
|
recordCount = value;
|
||
|
if (OnPageInfoChanged != null)
|
||
|
{
|
||
|
OnPageInfoChanged(this);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endregion 属性变量
|
||
|
}
|
||
|
}
|