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
- FactoryGenerator.cs
- ByteStream.cs
- SimpleHandlerFactory.cs
- WindowsFormsHostPropertyMap.cs
- FilteredReadOnlyMetadataCollection.cs
- CodeAttributeDeclarationCollection.cs
- ControlValuePropertyAttribute.cs
- ScanQueryOperator.cs
- MiniAssembly.cs
- ChangePassword.cs
- Encoder.cs
- BamlMapTable.cs
- BackStopAuthenticationModule.cs
- DynamicFilter.cs
- DataSourceView.cs
- HotSpot.cs
- SQLString.cs
- Console.cs
- WorkflowInstanceContextProvider.cs
- QueryMath.cs
- OleDbDataReader.cs
- IdlingCommunicationPool.cs
- TypeBuilder.cs
- PerformanceCounterManager.cs
- WebSysDescriptionAttribute.cs
- BevelBitmapEffect.cs
- ProfileBuildProvider.cs
- DesignerGenericWebPart.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- DataGridComponentEditor.cs
- XPathNodeIterator.cs
- EventWaitHandleSecurity.cs
- EnumValAlphaComparer.cs
- Win32Native.cs
- EntityProxyTypeInfo.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- DataTableReader.cs
- _WebProxyDataBuilder.cs
- MdiWindowListItemConverter.cs
- WebReferenceOptions.cs
- CacheAxisQuery.cs
- SqlPersonalizationProvider.cs
- SqlInfoMessageEvent.cs
- ConfigurationValidatorBase.cs
- CompositeDataBoundControl.cs
- Image.cs
- File.cs
- BlurEffect.cs
- OdbcConnectionOpen.cs
- AssemblyBuilder.cs
- BufferedGraphicsManager.cs
- AssemblyResourceLoader.cs
- DateTimeSerializationSection.cs
- IndexedSelectQueryOperator.cs
- LinqDataSourceUpdateEventArgs.cs
- ProtocolsConfigurationEntry.cs
- ListView.cs
- CompositeCollection.cs
- ContextMarshalException.cs
- IListConverters.cs
- OleDbException.cs
- XPathParser.cs
- DataServiceExpressionVisitor.cs
- HtmlInputFile.cs
- BinaryObjectInfo.cs
- EntitySqlQueryBuilder.cs
- CodeMemberMethod.cs
- Win32.cs
- MachineKeyConverter.cs
- RemoteX509AsymmetricSecurityKey.cs
- TraceProvider.cs
- RequiredFieldValidator.cs
- CharStorage.cs
- DrawingBrush.cs
- PrimitiveDataContract.cs
- CompilerGeneratedAttribute.cs
- XmlLoader.cs
- TransactionFilter.cs
- ApplicationInterop.cs
- TimeSpanMinutesConverter.cs
- TextReader.cs
- PersonalizationStateInfo.cs
- Constraint.cs
- ButtonBaseAdapter.cs
- StylusPlugin.cs
- EventMappingSettingsCollection.cs
- HttpCachePolicy.cs
- JsonXmlDataContract.cs
- ServerProtocol.cs
- RootDesignerSerializerAttribute.cs
- ImageKeyConverter.cs
- CodePageEncoding.cs
- Rect3D.cs
- TemplateField.cs
- WebSysDisplayNameAttribute.cs
- TimeoutException.cs
- ListManagerBindingsCollection.cs
- InheritanceAttribute.cs
- XPathDocumentBuilder.cs
- HealthMonitoringSectionHelper.cs