Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / MIT / System / Web / UI / MobileControls / Adapters / XhtmlAdapters / XhtmlBasicListAdapter.cs / 1305376 / XhtmlBasicListAdapter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Globalization; using System.Security.Permissions; using System.Web.Mobile; using System.Web.UI.MobileControls; using System.Web.UI.MobileControls.Adapters; #if COMPILING_FOR_SHIPPED_SOURCE namespace System.Web.UI.MobileControls.ShippedAdapterSource.XhtmlAdapters #else namespace System.Web.UI.MobileControls.Adapters.XhtmlAdapters #endif { ///[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 XhtmlListAdapter : XhtmlControlAdapter { /// protected new List Control { get { return base.Control as List; } } /// public override void Render (XhtmlMobileTextWriter writer) { if (Control.HasControls()) { ConditionalRenderOpeningDivElement(writer); RenderChildren (writer); ConditionalRenderClosingDivElement(writer); return; } if (Control.Items.Count != 0) { ClearPendingBreakIfDeviceBreaksOnBlockLevel(writer); // we are writing a block level element in all cases. } ConditionalEnterLayout(writer, Style); RenderList (writer); ConditionalExitLayout(writer, Style); } /// protected virtual void RenderList (XhtmlMobileTextWriter writer) { MobileListItemCollection items = Control.Items; if (items.Count == 0) { return; } ListDecoration decoration = Control.Decoration; // Review: Consider replacing switch. switch (decoration) { case ListDecoration.Bulleted: RenderBulletedList (writer); break; case ListDecoration.Numbered: RenderNumberedList (writer); break; default: if (!Device.Tables) { RenderUndecoratedList(writer); return; } RenderTableList (writer); break; } } private void RenderBulletedList (XhtmlMobileTextWriter writer) { RenderOpeningListTag(writer, "ul"); RenderListBody (writer, "
" : "
"; if((string)Device["usePOverDiv"] == "true") br = "
"; RenderListBody (writer, "", br); } private void RenderListItem (XhtmlMobileTextWriter writer, MobileListItem item) { String accessKey = GetCustomAttributeValue(item, XhtmlConstants.AccessKeyCustomAttribute); String cssClass = GetCustomAttributeValue(item, XhtmlConstants.CssClassCustomAttribute); if (Control.ItemsAsLinks) { RenderBeginLink (writer, item.Value, accessKey, Style, cssClass); writer.WriteEncodedText (item.Text); RenderEndLink (writer); } else if (Control.HasItemCommandHandler) { RenderPostBackEventAsAnchor (writer, item.Index.ToString(CultureInfo.InvariantCulture) /*event argument*/, item.Text /*link text*/, accessKey, Style, cssClass); } else { writer.WriteEncodedText (item.Text); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
"; if((string)Device["usePOverDiv"] == "true") br = "
"; RenderListBody (writer, "", br); } private void RenderListItem (XhtmlMobileTextWriter writer, MobileListItem item) { String accessKey = GetCustomAttributeValue(item, XhtmlConstants.AccessKeyCustomAttribute); String cssClass = GetCustomAttributeValue(item, XhtmlConstants.CssClassCustomAttribute); if (Control.ItemsAsLinks) { RenderBeginLink (writer, item.Value, accessKey, Style, cssClass); writer.WriteEncodedText (item.Text); RenderEndLink (writer); } else if (Control.HasItemCommandHandler) { RenderPostBackEventAsAnchor (writer, item.Index.ToString(CultureInfo.InvariantCulture) /*event argument*/, item.Text /*link text*/, accessKey, Style, cssClass); } else { writer.WriteEncodedText (item.Text); } } } } // 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
- OleDbErrorCollection.cs
- IpcClientChannel.cs
- HtmlSelectionListAdapter.cs
- Location.cs
- CodeAccessPermission.cs
- relpropertyhelper.cs
- Rotation3D.cs
- XmlAtomErrorReader.cs
- X509Certificate.cs
- ClassicBorderDecorator.cs
- TypeNameConverter.cs
- DataControlFieldHeaderCell.cs
- Inline.cs
- Empty.cs
- DataGridViewRowsRemovedEventArgs.cs
- LineMetrics.cs
- DocumentApplicationJournalEntry.cs
- ExecutionContext.cs
- Aggregates.cs
- BamlCollectionHolder.cs
- PointF.cs
- TickBar.cs
- SQLUtility.cs
- ToolStripLocationCancelEventArgs.cs
- _ConnectionGroup.cs
- XmlDownloadManager.cs
- ContentElementAutomationPeer.cs
- DynamicScriptObject.cs
- SystemPens.cs
- GridViewActionList.cs
- StylusLogic.cs
- Matrix3DConverter.cs
- Viewport3DAutomationPeer.cs
- CommandDevice.cs
- Part.cs
- DataSourceCacheDurationConverter.cs
- PasswordRecovery.cs
- WebReferenceCollection.cs
- CustomExpression.cs
- TransactionScope.cs
- DataSourceCache.cs
- TextBox.cs
- LocalizedNameDescriptionPair.cs
- InstancePersistence.cs
- GridViewDesigner.cs
- ExtensionWindow.cs
- ReliableReplySessionChannel.cs
- WindowsGraphics.cs
- AnchoredBlock.cs
- ColumnReorderedEventArgs.cs
- TextEditorTyping.cs
- HistoryEventArgs.cs
- ResourceDisplayNameAttribute.cs
- MemberDescriptor.cs
- DateTimeOffsetAdapter.cs
- ToolboxItem.cs
- InputBuffer.cs
- ConstraintStruct.cs
- DataSourceBooleanViewSchemaConverter.cs
- NumericUpDown.cs
- ProcessHostServerConfig.cs
- EntitySetDataBindingList.cs
- FixedStringLookup.cs
- SerializationHelper.cs
- MouseButton.cs
- FieldNameLookup.cs
- WindowsScrollBarBits.cs
- SrgsToken.cs
- ManageRequest.cs
- SoapSchemaImporter.cs
- WSSecurityOneDotOneSendSecurityHeader.cs
- AdornedElementPlaceholder.cs
- ConfigXmlWhitespace.cs
- Metafile.cs
- EntryPointNotFoundException.cs
- IImplicitResourceProvider.cs
- ToolStripHighContrastRenderer.cs
- DynamicActionMessageFilter.cs
- OciHandle.cs
- EncodingTable.cs
- RegexGroup.cs
- IIS7WorkerRequest.cs
- SamlAssertion.cs
- MarshalByValueComponent.cs
- CardSpacePolicyElement.cs
- ConfigurationValues.cs
- DesignerTextViewAdapter.cs
- ContainerParagraph.cs
- WebPartVerbsEventArgs.cs
- Focus.cs
- LineServicesRun.cs
- Typeface.cs
- QueryResponse.cs
- DBConcurrencyException.cs
- SqlDataSourceCommandParser.cs
- TaskFormBase.cs
- InputScopeNameConverter.cs
- MessageQueueEnumerator.cs
- ProxyHelper.cs
- ObjectReaderCompiler.cs