| |||||||||||||||||
Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
Pagination\IPaginatedList.cs | - | - | - | - |
|
1 | ||
2 | #region Apache Notice | |
3 | /***************************************************************************** | |
4 | * $Header: $ | |
5 | * $Revision: $ | |
6 | * $Date: $ | |
7 | * | |
8 | * iBATIS.NET Data Mapper | |
9 | * Copyright (C) 2004 - Gilles Bayon | |
10 | * | |
11 | * | |
12 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
13 | * you may not use this file except in compliance with the License. | |
14 | * You may obtain a copy of the License at | |
15 | * | |
16 | * http://www.apache.org/licenses/LICENSE-2.0 | |
17 | * | |
18 | * Unless required by applicable law or agreed to in writing, software | |
19 | * distributed under the License is distributed on an "AS IS" BASIS, | |
20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
21 | * See the License for the specific language governing permissions and | |
22 | * limitations under the License. | |
23 | * | |
24 | ********************************************************************************/ | |
25 | #endregion | |
26 | ||
27 | using System; | |
28 | using System.Collections; | |
29 | ||
30 | namespace IBatisNet.Common.Pagination | |
31 | { | |
32 | /// <summary> | |
33 | /// Summary description for IPaginatedList. | |
34 | /// </summary> | |
35 | public interface IPaginatedList : IList, IEnumerator | |
36 | { | |
37 | ||
38 | /// <summary> | |
39 | /// The maximum number of items per page. | |
40 | /// </summary> | |
41 | int PageSize | |
42 | { | |
43 | get; | |
44 | } | |
45 | ||
46 | ||
47 | /// <summary> | |
48 | /// Is the current page the first page ? | |
49 | /// True if the current page is the first page or if only | |
50 | /// a single page exists. | |
51 | /// </summary> | |
52 | bool IsFirstPage | |
53 | { | |
54 | get; | |
55 | } | |
56 | ||
57 | ||
58 | /// <summary> | |
59 | /// Is the current page a middle page (i.e. not first or last) ? | |
60 | /// Return True if the current page is not the first or last page, | |
61 | /// and more than one page exists (always returns false if only a | |
62 | /// single page exists). | |
63 | /// </summary> | |
64 | bool IsMiddlePage | |
65 | { | |
66 | get; | |
67 | } | |
68 | ||
69 | ||
70 | /// <summary> | |
71 | /// Is the current page the last page ? | |
72 | /// Return True if the current page is the last page or if only | |
73 | /// a single page exists. | |
74 | /// </summary> | |
75 | bool IsLastPage | |
76 | { | |
77 | get; | |
78 | } | |
79 | ||
80 | ||
81 | /// <summary> | |
82 | /// Is a page available after the current page ? | |
83 | /// Return True if the next page is available | |
84 | /// </summary> | |
85 | bool IsNextPageAvailable | |
86 | { | |
87 | get; | |
88 | } | |
89 | ||
90 | ||
91 | /// <summary> | |
92 | /// Is a page available before the current page ? | |
93 | /// Return True if the previous page is available | |
94 | /// </summary> | |
95 | bool IsPreviousPageAvailable | |
96 | { | |
97 | get; | |
98 | } | |
99 | ||
100 | ||
101 | /// <summary> | |
102 | /// Moves to the next page after the current page. If the current | |
103 | /// page is the last page, wrap to the first page. | |
104 | /// </summary> | |
105 | /// <returns></returns> | |
106 | bool NextPage(); | |
107 | ||
108 | ||
109 | /// <summary> | |
110 | /// Moves to the page before the current page. If the current | |
111 | /// page is the first page, wrap to the last page. | |
112 | /// </summary> | |
113 | /// <returns></returns> | |
114 | bool PreviousPage(); | |
115 | ||
116 | ||
117 | /// <summary> | |
118 | /// Moves to a specified page. If the specified | |
119 | /// page is beyond the last page, wrap to the first page. | |
120 | /// If the specified page is before the first page, wrap | |
121 | /// to the last page. | |
122 | /// </summary> | |
123 | /// <param name="pageIndex">The index of the specified page.</param> | |
124 | void GotoPage(int pageIndex); | |
125 | ||
126 | ||
127 | /// <summary> | |
128 | /// Returns the current page index, which is a zero based integer. | |
129 | /// All paginated list implementations should know what index they are | |
130 | /// on, even if they don't know the ultimate boundaries (min/max) | |
131 | /// </summary> | |
132 | int PageIndex | |
133 | { | |
134 | get; | |
135 | } | |
136 | ||
137 | } | |
138 | } | |
139 |
|