Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / MIT / System / Web / UI / MobileControls / Adapters / WmlListAdapter.cs / 1305376 / WmlListAdapter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Globalization; using System.IO; using System.Web; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.MobileControls; using System.Security.Permissions; #if COMPILING_FOR_SHIPPED_SOURCE namespace System.Web.UI.MobileControls.ShippedAdapterSource #else namespace System.Web.UI.MobileControls.Adapters #endif { /* * WmlListAdapter provides the wml device functionality for List controls. * * Copyright (c) 2000 Microsoft Corporation */ ///[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 WmlListAdapter : WmlControlAdapter { /// protected new List Control { get { return (List)base.Control; } } /// public override void OnInit(EventArgs e) { } /// public override void Render(WmlMobileTextWriter writer) { if(Control.HasControls()) { writer.BeginCustomMarkup(); RenderChildren(writer); writer.EndCustomMarkup(); return; } int pageStart = Control.FirstVisibleItemIndex; int pageSize = Control.VisibleItemCount; if (pageSize == 0) { return; } MobileListItemCollection items = Control.Items; if (items.Count == 0) { return; } bool itemsAsLinks = Control.ItemsAsLinks; bool hasCmdHandler = Control.HasItemCommandHandler; writer.EnterStyle(Style); for (int i = 0; i < pageSize; i++) { MobileListItem item = items[pageStart + i]; if (itemsAsLinks) { RenderLink(writer, item.Value, null, false, false, item.Text, true); } else if (hasCmdHandler) { RenderPostBackEvent(writer, item.Index.ToString(CultureInfo.InvariantCulture), null, true, item.Text, true); } else { writer.RenderText(item.Text, true); } } writer.ExitStyle(Style); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Globalization; using System.IO; using System.Web; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.MobileControls; using System.Security.Permissions; #if COMPILING_FOR_SHIPPED_SOURCE namespace System.Web.UI.MobileControls.ShippedAdapterSource #else namespace System.Web.UI.MobileControls.Adapters #endif { /* * WmlListAdapter provides the wml device functionality for List controls. * * Copyright (c) 2000 Microsoft Corporation */ ///[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 WmlListAdapter : WmlControlAdapter { /// protected new List Control { get { return (List)base.Control; } } /// public override void OnInit(EventArgs e) { } /// public override void Render(WmlMobileTextWriter writer) { if(Control.HasControls()) { writer.BeginCustomMarkup(); RenderChildren(writer); writer.EndCustomMarkup(); return; } int pageStart = Control.FirstVisibleItemIndex; int pageSize = Control.VisibleItemCount; if (pageSize == 0) { return; } MobileListItemCollection items = Control.Items; if (items.Count == 0) { return; } bool itemsAsLinks = Control.ItemsAsLinks; bool hasCmdHandler = Control.HasItemCommandHandler; writer.EnterStyle(Style); for (int i = 0; i < pageSize; i++) { MobileListItem item = items[pageStart + i]; if (itemsAsLinks) { RenderLink(writer, item.Value, null, false, false, item.Text, true); } else if (hasCmdHandler) { RenderPostBackEvent(writer, item.Index.ToString(CultureInfo.InvariantCulture), null, true, item.Text, true); } else { writer.RenderText(item.Text, true); } } writer.ExitStyle(Style); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlLink.cs
- WindowsEditBox.cs
- KnownTypes.cs
- Trigger.cs
- TableDetailsCollection.cs
- ValidationRule.cs
- AppDomainFactory.cs
- AnonymousIdentificationModule.cs
- OpCodes.cs
- CryptoStream.cs
- SystemIcmpV6Statistics.cs
- AnimationException.cs
- TableItemPattern.cs
- TypeLibConverter.cs
- SqlTypesSchemaImporter.cs
- AnimatedTypeHelpers.cs
- WebReferencesBuildProvider.cs
- ellipse.cs
- CorrelationManager.cs
- ProfileGroupSettingsCollection.cs
- WebConfigurationHostFileChange.cs
- SmtpCommands.cs
- XmlSchemaComplexContentRestriction.cs
- HttpInputStream.cs
- DocumentPage.cs
- FindCriteria.cs
- PackagingUtilities.cs
- IndexedGlyphRun.cs
- Style.cs
- Validator.cs
- SqlParameterizer.cs
- Pair.cs
- Task.cs
- WizardForm.cs
- TextClipboardData.cs
- DisplayInformation.cs
- RootProfilePropertySettingsCollection.cs
- TraceHwndHost.cs
- ToolStripItemEventArgs.cs
- TextPatternIdentifiers.cs
- CqlErrorHelper.cs
- ModelFunctionTypeElement.cs
- BaseResourcesBuildProvider.cs
- ObjectDataSourceStatusEventArgs.cs
- GeneralEndpointIdentity.cs
- ControlsConfig.cs
- CodeStatementCollection.cs
- TextParaLineResult.cs
- DelegatingHeader.cs
- WindowsProgressbar.cs
- MemberListBinding.cs
- EllipseGeometry.cs
- TypeValidationEventArgs.cs
- JsonFormatReaderGenerator.cs
- ManualWorkflowSchedulerService.cs
- KerberosTicketHashIdentifierClause.cs
- WebPartTransformerCollection.cs
- CriticalFinalizerObject.cs
- StylusPlugInCollection.cs
- TypographyProperties.cs
- ProgressPage.cs
- HttpRuntime.cs
- PresentationAppDomainManager.cs
- EnumMember.cs
- ByteStreamGeometryContext.cs
- SystemThemeKey.cs
- CredentialCache.cs
- ButtonAutomationPeer.cs
- MutableAssemblyCacheEntry.cs
- Compilation.cs
- RenderContext.cs
- MemoryRecordBuffer.cs
- SqlNodeAnnotations.cs
- PartitionResolver.cs
- Number.cs
- DataGridViewImageColumn.cs
- CompilerError.cs
- DataGridViewCellStyleConverter.cs
- XmlComment.cs
- XsdBuildProvider.cs
- InvariantComparer.cs
- SizeConverter.cs
- UniqueIdentifierService.cs
- PanelStyle.cs
- InputLanguage.cs
- OracleInternalConnection.cs
- CustomWebEventKey.cs
- DataRowIndexBuffer.cs
- AccessKeyManager.cs
- BrowserCapabilitiesCodeGenerator.cs
- ExceptionHandlerDesigner.cs
- RepeaterDataBoundAdapter.cs
- SecurityAttributeGenerationHelper.cs
- JsonWriter.cs
- Viewport3DAutomationPeer.cs
- RuleCache.cs
- XmlBinaryReader.cs
- IndentedWriter.cs
- RowCache.cs
- RawAppCommandInputReport.cs