1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
//------------------------------------------------------------------------------
// <copyright file="PageStyle.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Security.Permissions;
namespace System.Web.UI.MobileControls
{
/*
* Pager Style class. Style properties used to render a form pagination UI.
*
* Copyright (c) 2000 Microsoft Corporation
*/
/// <include file='doc\PagerStyle.uex' path='docs/doc[@for="PagerStyle"]/*' />
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")]
public class PagerStyle : Style
{
/// <include file='doc\PagerStyle.uex' path='docs/doc[@for="PagerStyle.NextPageTextKey"]/*' />
public static readonly Object
NextPageTextKey = RegisterStyle("NextPageText", typeof(String), String.Empty, false),
PreviousPageTextKey = RegisterStyle("PreviousPageText", typeof(String), String.Empty, false),
PageLabelKey = RegisterStyle("PageLabel", typeof(String), String.Empty, false);
/// <include file='doc\PagerStyle.uex' path='docs/doc[@for="PagerStyle.NextPageText"]/*' />
[
Bindable(true),
DefaultValue(""),
MobileCategory(SR.Category_Appearance),
MobileSysDescription(SR.PagerStyle_NextPageText),
NotifyParentProperty(true),
]
public String NextPageText
{
get
{
return (String)this[NextPageTextKey];
}
set
{
this[NextPageTextKey] = value;
}
}
/// <include file='doc\PagerStyle.uex' path='docs/doc[@for="PagerStyle.PreviousPageText"]/*' />
[
Bindable(true),
DefaultValue(""),
MobileCategory(SR.Category_Appearance),
MobileSysDescription(SR.PagerStyle_PreviousPageText),
NotifyParentProperty(true),
]
public String PreviousPageText
{
get
{
return (String)this[PreviousPageTextKey];
}
set
{
this[PreviousPageTextKey] = value;
}
}
/// <include file='doc\PagerStyle.uex' path='docs/doc[@for="PagerStyle.PageLabel"]/*' />
[
Bindable(true),
DefaultValue(""),
MobileCategory(SR.Category_Appearance),
MobileSysDescription(SR.PagerStyle_PageLabel),
NotifyParentProperty(true),
]
public String PageLabel
{
get
{
return (String)this[PageLabelKey];
}
set
{
this[PageLabelKey] = value;
}
}
/// <include file='doc\PagerStyle.uex' path='docs/doc[@for="PagerStyle.GetNextPageText"]/*' />
public String GetNextPageText(int currentPageIndex)
{
String s = (String)this[NextPageTextKey, true];
if (!String.IsNullOrEmpty(s))
{
return String.Format(CultureInfo.CurrentCulture, s, currentPageIndex + 1);
}
else
{
return SR.GetString(SR.PagerStyle_NextPageText_DefaultValue);
}
}
/// <include file='doc\PagerStyle.uex' path='docs/doc[@for="PagerStyle.GetPreviousPageText"]/*' />
public String GetPreviousPageText(int currentPageIndex)
{
String s = (String)this[PreviousPageTextKey, true];
if (!String.IsNullOrEmpty(s))
{
return String.Format(CultureInfo.CurrentCulture, s, currentPageIndex - 1);
}
else
{
return SR.GetString(SR.PagerStyle_PreviousPageText_DefaultValue);
}
}
/// <include file='doc\PagerStyle.uex' path='docs/doc[@for="PagerStyle.GetPageLabelText"]/*' />
public String GetPageLabelText(int currentPageIndex, int pageCount)
{
String s = (String)this[PageLabelKey, true];
if (s == null)
{
s = String.Empty;
}
if (s.Length > 0)
{
s = String.Format(CultureInfo.CurrentCulture, s, currentPageIndex, pageCount);
}
return s;
}
}
}
|