mirror of
https://github.com/wagesj45/CapyKit.git
synced 2024-10-18 15:01:52 -05:00
79 lines
2.6 KiB
Markdown
79 lines
2.6 KiB
Markdown
|
# PageCount<T>(IEnumerable<T>, Int32) Method
|
|||
|
|
|||
|
|
|||
|
The number of pages of *pageSize* size in the given collection.
|
|||
|
|
|||
|
|
|||
|
|
|||
|
## Definition
|
|||
|
**Namespace:** <a href="N_CapyKit_Extensions">CapyKit.Extensions</a>
|
|||
|
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+6cdd805be49c3b769a116584ea6904955ecd820d
|
|||
|
|
|||
|
**C#**
|
|||
|
``` C#
|
|||
|
public static int PageCount<T>(
|
|||
|
this IEnumerable<T> source,
|
|||
|
int pageSize
|
|||
|
)
|
|||
|
|
|||
|
```
|
|||
|
**VB**
|
|||
|
``` VB
|
|||
|
<ExtensionAttribute>
|
|||
|
Public Shared Function PageCount(Of T) (
|
|||
|
source As IEnumerable(Of T),
|
|||
|
pageSize As Integer
|
|||
|
) As Integer
|
|||
|
```
|
|||
|
**C++**
|
|||
|
``` C++
|
|||
|
public:
|
|||
|
[ExtensionAttribute]
|
|||
|
generic<typename T>
|
|||
|
static int PageCount(
|
|||
|
IEnumerable<T>^ source,
|
|||
|
int pageSize
|
|||
|
)
|
|||
|
```
|
|||
|
**F#**
|
|||
|
``` F#
|
|||
|
[<ExtensionAttribute>]
|
|||
|
static member PageCount :
|
|||
|
source : IEnumerable<'T> *
|
|||
|
pageSize : int -> int
|
|||
|
```
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#### Parameters
|
|||
|
<dl><dt> <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1" target="_blank" rel="noopener noreferrer">IEnumerable</a>(T)</dt><dd>The source to act on.</dd><dt> <a href="https://learn.microsoft.com/dotnet/api/system.int32" target="_blank" rel="noopener noreferrer">Int32</a></dt><dd>Size of the page.</dd></dl>
|
|||
|
|
|||
|
#### Type Parameters
|
|||
|
<dl><dt /><dd>Generic type parameter.</dd></dl>
|
|||
|
|
|||
|
#### Return Value
|
|||
|
<a href="https://learn.microsoft.com/dotnet/api/system.int32" target="_blank" rel="noopener noreferrer">Int32</a>
|
|||
|
An int.
|
|||
|
|
|||
|
#### Usage Note
|
|||
|
In Visual Basic and C#, you can call this method as an instance method on any object of type <a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1" target="_blank" rel="noopener noreferrer">IEnumerable</a>(T). When you use instance method syntax to call this method, omit the first parameter. For more information, see <a href="https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods" target="_blank" rel="noopener noreferrer">
|
|||
|
|
|||
|
Extension Methods (Visual Basic)</a> or <a href="https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods" target="_blank" rel="noopener noreferrer">
|
|||
|
|
|||
|
Extension Methods (C# Programming Guide)</a>.
|
|||
|
|
|||
|
## Exceptions
|
|||
|
<table>
|
|||
|
<tr>
|
|||
|
<td><a href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception" target="_blank" rel="noopener noreferrer">ArgumentOutOfRangeException</a></td>
|
|||
|
<td>Thrown when <em>pageSize</em> is less than <code>1</code>.</td></tr>
|
|||
|
</table>
|
|||
|
|
|||
|
## See Also
|
|||
|
|
|||
|
|
|||
|
#### Reference
|
|||
|
<a href="T_CapyKit_Extensions_LINQExtensions">LINQExtensions Class</a>
|
|||
|
<a href="Overload_CapyKit_Extensions_LINQExtensions_PageCount">PageCount Overload</a>
|
|||
|
<a href="N_CapyKit_Extensions">CapyKit.Extensions Namespace</a>
|