Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / MIT / System / Web / UI / MobileControls / Adapters / ChtmlImageAdapter.cs / 1305376 / ChtmlImageAdapter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Globalization; using System.Web.UI.MobileControls.Adapters; using System.Security.Permissions; #if COMPILING_FOR_SHIPPED_SOURCE namespace System.Web.UI.MobileControls.ShippedAdapterSource #else namespace System.Web.UI.MobileControls.Adapters #endif { /* * ChtmlImageAdapter class. */ ///[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 ChtmlImageAdapter : HtmlImageAdapter { /// protected internal override void RenderImage(HtmlMobileTextWriter writer) { String source = Control.ImageUrl; if (source.StartsWith(Constants.SymbolProtocol, StringComparison.Ordinal) && (Device.SupportsIModeSymbols || Device.SupportsJPhoneSymbols)) { if (Device.SupportsIModeSymbols) { writer.Write(""); writer.Write( source.Substring(Constants.SymbolProtocol.Length)); writer.Write(";"); } else { // The ImageUrl should be in the format "symbol:xyyy", // where x is group picture character (either G, E or F), // and yyy (length can vary) is the picture's character // code (in decimal). String symbolChars = source.Substring( Constants.SymbolProtocol.Length); char code = DecimalStringToChar(symbolChars.Substring(1)); writer.Write("\u001B$"); writer.Write(Char.ToUpper(symbolChars[0], CultureInfo.InvariantCulture)); writer.Write(code); writer.Write('\u000F'); } } else { base.RenderImage(writer); } } // Convert decimal string "xxx" to '\u00xx' private char DecimalStringToChar(String decimalString) { int codeValue = 0; int adj = 1; for (int i = decimalString.Length - 1; i >= 0; i--) { codeValue += DecimalCharToInt(decimalString[i]) * adj; adj *= 10; } return (char) codeValue; } // Convert decimal char 'x' to decimal integer value x private int DecimalCharToInt(char decimalChar) { int i; if (decimalChar >= '0' && decimalChar <= '9') { i = decimalChar - '0'; } else { throw new ArgumentException( SR.GetString(SR.ChtmlImageAdapterDecimalCodeExpectedAfterGroupChar), "ImageUrl"); } return i; } /// protected override void AddAttributes(HtmlMobileTextWriter writer) { AddAccesskeyAttribute(writer); AddJPhoneMultiMediaAttributes(writer); } } } // 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
- ProvidersHelper.cs
- ActivityBuilderHelper.cs
- DiscoveryClientChannelFactory.cs
- TabControlEvent.cs
- WebUtil.cs
- ButtonBaseAutomationPeer.cs
- CollectionConverter.cs
- Menu.cs
- HandlerFactoryCache.cs
- ClearCollection.cs
- TimelineClockCollection.cs
- FacetDescriptionElement.cs
- ListViewTableRow.cs
- recordstatescratchpad.cs
- StyleBamlTreeBuilder.cs
- CalculatedColumn.cs
- PointAnimationClockResource.cs
- BinaryQueryOperator.cs
- ITreeGenerator.cs
- OletxEnlistment.cs
- ItemsChangedEventArgs.cs
- FormViewModeEventArgs.cs
- XmlReaderDelegator.cs
- CommonRemoteMemoryBlock.cs
- MailMessageEventArgs.cs
- ExtensionWindowResizeGrip.cs
- DrawListViewItemEventArgs.cs
- ProcessActivityTreeOptions.cs
- RtfFormatStack.cs
- PersistChildrenAttribute.cs
- DataGridTextBox.cs
- MaterializeFromAtom.cs
- TextChange.cs
- BulletChrome.cs
- DataError.cs
- TCPClient.cs
- Encoder.cs
- SymDocumentType.cs
- SafeNativeMethods.cs
- PointHitTestResult.cs
- EntityReference.cs
- SessionIDManager.cs
- PenContext.cs
- ISessionStateStore.cs
- OleDbSchemaGuid.cs
- Inflater.cs
- ObjectListDesigner.cs
- HyperLinkDataBindingHandler.cs
- VariableDesigner.xaml.cs
- MemberAccessException.cs
- CompositeFontFamily.cs
- PhonemeEventArgs.cs
- SchemaTableOptionalColumn.cs
- StatusBarPanelClickEvent.cs
- NotImplementedException.cs
- ImmutableObjectAttribute.cs
- COSERVERINFO.cs
- ChannelFactoryBase.cs
- IconHelper.cs
- SolidColorBrush.cs
- _MultipleConnectAsync.cs
- ISessionStateStore.cs
- FontFamily.cs
- ForeignKeyConstraint.cs
- SqlUtil.cs
- UserPrincipalNameElement.cs
- XmlUtf8RawTextWriter.cs
- LinkedResourceCollection.cs
- WebRequestModulesSection.cs
- SemanticResultKey.cs
- Material.cs
- SqlCacheDependencyDatabaseCollection.cs
- XmlLinkedNode.cs
- EventArgs.cs
- BrowserTree.cs
- DecoderExceptionFallback.cs
- PartialArray.cs
- CompilerScopeManager.cs
- SortedList.cs
- DynamicRouteExpression.cs
- FormViewUpdateEventArgs.cs
- TextMessageEncodingBindingElement.cs
- Imaging.cs
- BamlLocalizationDictionary.cs
- ConfigXmlCDataSection.cs
- TabletCollection.cs
- BoundingRectTracker.cs
- HashAlgorithm.cs
- TranslateTransform3D.cs
- TextDecorationLocationValidation.cs
- HttpHandlerAction.cs
- SqlTrackingQuery.cs
- CodeRemoveEventStatement.cs
- ReadOnlyHierarchicalDataSourceView.cs
- MimeWriter.cs
- DataPagerCommandEventArgs.cs
- WinFormsUtils.cs
- AttachInfo.cs
- PersistenceIOParticipant.cs
- IpcManager.cs