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
- EventLogRecord.cs
- WebServiceErrorEvent.cs
- XmlWrappingReader.cs
- AssertSection.cs
- SByte.cs
- Listbox.cs
- ToolTip.cs
- Visual.cs
- Double.cs
- FixedSOMGroup.cs
- DecoderBestFitFallback.cs
- HwndTarget.cs
- XmlSchemaGroupRef.cs
- CheckBox.cs
- EraserBehavior.cs
- BuildManager.cs
- TreeWalker.cs
- SpeechEvent.cs
- SqlTypesSchemaImporter.cs
- Label.cs
- SystemIcmpV4Statistics.cs
- InvalidPrinterException.cs
- StreamSecurityUpgradeProvider.cs
- GACMembershipCondition.cs
- SettingsPropertyWrongTypeException.cs
- WindowsContainer.cs
- UnlockInstanceCommand.cs
- EventSetter.cs
- BaseUriHelper.cs
- CodeValidator.cs
- Rfc2898DeriveBytes.cs
- WorkflowInstanceAbortedRecord.cs
- WebConfigurationFileMap.cs
- CanonicalFontFamilyReference.cs
- Authorization.cs
- ExpressionBuilderCollection.cs
- Color.cs
- JournalNavigationScope.cs
- LineMetrics.cs
- ExpressionDumper.cs
- OpenFileDialog.cs
- InstanceData.cs
- WmlLabelAdapter.cs
- FixedSOMSemanticBox.cs
- ObjectParameter.cs
- AuthenticationModulesSection.cs
- MetadataArtifactLoaderComposite.cs
- SqlRecordBuffer.cs
- SHA1.cs
- DifferencingCollection.cs
- ObjectParameter.cs
- HostProtectionPermission.cs
- PointLight.cs
- TextEditorSelection.cs
- UniqueEventHelper.cs
- XmlAnyAttributeAttribute.cs
- RecognitionResult.cs
- SendingRequestEventArgs.cs
- EntityDataSourceDataSelection.cs
- BamlRecordWriter.cs
- ForceCopyBuildProvider.cs
- CannotUnloadAppDomainException.cs
- ProxyWebPartManager.cs
- XmlAnyElementAttribute.cs
- CodeAttributeDeclaration.cs
- AmbientLight.cs
- MonthCalendar.cs
- Int64Storage.cs
- RulePatternOps.cs
- XmlSchemaSimpleType.cs
- ObjectAnimationBase.cs
- ScriptComponentDescriptor.cs
- OdbcDataAdapter.cs
- WindowsHyperlink.cs
- RelationshipManager.cs
- StyleCollection.cs
- CombinedGeometry.cs
- CompositeFontInfo.cs
- TreeNodeSelectionProcessor.cs
- DataTableMapping.cs
- HtmlListAdapter.cs
- Size.cs
- DocobjHost.cs
- DragStartedEventArgs.cs
- PipeStream.cs
- MailMessageEventArgs.cs
- WrapperSecurityCommunicationObject.cs
- Expression.cs
- DoubleUtil.cs
- X500Name.cs
- TerminateDesigner.cs
- DataChangedEventManager.cs
- ExpressionList.cs
- HtmlTableCell.cs
- CommonServiceBehaviorElement.cs
- InheritanceAttribute.cs
- ColumnClickEvent.cs
- PerspectiveCamera.cs
- RequestCachingSection.cs
- WeakReadOnlyCollection.cs