Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / MIT / System / Web / UI / MobileControls / Adapters / ChtmlTextBoxAdapter.cs / 1305376 / ChtmlTextBoxAdapter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Security.Permissions; #if COMPILING_FOR_SHIPPED_SOURCE namespace System.Web.UI.MobileControls.ShippedAdapterSource #else namespace System.Web.UI.MobileControls.Adapters #endif { /* * ChtmlTextBoxAdapter class. * * 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 ChtmlTextBoxAdapter : HtmlTextBoxAdapter { private static Random _random = new Random(); /// protected override void AddAttributes(HtmlMobileTextWriter writer) { if (Control.Numeric) { if (Device.SupportsInputIStyle) { // The default input mode is always numeric if the // type is password. if (!Control.Password) { writer.WriteAttribute("istyle", "4"); } } else if (Device.SupportsInputMode) { writer.WriteAttribute("mode", "numeric"); } } AddAccesskeyAttribute(writer); AddJPhoneMultiMediaAttributes(writer); } /// public override bool RequiresFormTag { get { return true; } } private String GetRandomID(int length) { Byte[] randomBytes = new Byte[length]; _random.NextBytes(randomBytes); char[] randomChars = new char[length]; for (int i = 0; i < length; i++) { randomChars[i] = (char)((((int)randomBytes[i]) % 26) + 'a'); } return new String(randomChars); } internal override String GetRenderName() { String renderName = base.GetRenderName(); if (Device.RequiresUniqueHtmlInputNames) { renderName += Constants.SelectionListSpecialCharacter + GetRandomID(4); } return renderName; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Security.Permissions; #if COMPILING_FOR_SHIPPED_SOURCE namespace System.Web.UI.MobileControls.ShippedAdapterSource #else namespace System.Web.UI.MobileControls.Adapters #endif { /* * ChtmlTextBoxAdapter class. * * 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 ChtmlTextBoxAdapter : HtmlTextBoxAdapter { private static Random _random = new Random(); /// protected override void AddAttributes(HtmlMobileTextWriter writer) { if (Control.Numeric) { if (Device.SupportsInputIStyle) { // The default input mode is always numeric if the // type is password. if (!Control.Password) { writer.WriteAttribute("istyle", "4"); } } else if (Device.SupportsInputMode) { writer.WriteAttribute("mode", "numeric"); } } AddAccesskeyAttribute(writer); AddJPhoneMultiMediaAttributes(writer); } /// public override bool RequiresFormTag { get { return true; } } private String GetRandomID(int length) { Byte[] randomBytes = new Byte[length]; _random.NextBytes(randomBytes); char[] randomChars = new char[length]; for (int i = 0; i < length; i++) { randomChars[i] = (char)((((int)randomBytes[i]) % 26) + 'a'); } return new String(randomChars); } internal override String GetRenderName() { String renderName = base.GetRenderName(); if (Device.RequiresUniqueHtmlInputNames) { renderName += Constants.SelectionListSpecialCharacter + GetRandomID(4); } return renderName; } } } // 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
- AmbiguousMatchException.cs
- CommonObjectSecurity.cs
- XmlTextReaderImpl.cs
- DrawingBrush.cs
- TextDecorationLocationValidation.cs
- SchemaDeclBase.cs
- EdgeProfileValidation.cs
- XsltSettings.cs
- RegexParser.cs
- DataControlFieldCell.cs
- GridViewRowPresenter.cs
- HttpClientProtocol.cs
- XmlSchemaAnnotated.cs
- WmiEventSink.cs
- WindowsSecurityTokenAuthenticator.cs
- KnownTypesHelper.cs
- LeaseManager.cs
- DocumentPage.cs
- CodeObjectCreateExpression.cs
- RawUIStateInputReport.cs
- HMAC.cs
- CategoriesDocument.cs
- DesignSurfaceEvent.cs
- CollectionEditor.cs
- MaterialCollection.cs
- ClientUrlResolverWrapper.cs
- OracleCommandSet.cs
- ActivationArguments.cs
- BamlVersionHeader.cs
- GridView.cs
- UpDownBaseDesigner.cs
- DataGridViewCell.cs
- PathSegmentCollection.cs
- _StreamFramer.cs
- StateRuntime.cs
- PageRanges.cs
- EpmSyndicationContentSerializer.cs
- HttpChannelFactory.cs
- RowToParametersTransformer.cs
- ContainsSearchOperator.cs
- MethodAccessException.cs
- SettingsPropertyIsReadOnlyException.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- ObjectListCommandsPage.cs
- TextUtf8RawTextWriter.cs
- DataGridViewCellStyleChangedEventArgs.cs
- DBConnection.cs
- PropertyValueChangedEvent.cs
- JsonReader.cs
- GeometryDrawing.cs
- HuffModule.cs
- DataGridColumnCollection.cs
- SchemaImporterExtensionsSection.cs
- SharedConnectionInfo.cs
- OraclePermission.cs
- TaiwanLunisolarCalendar.cs
- SizeFConverter.cs
- SignatureDescription.cs
- Viewport3DAutomationPeer.cs
- Solver.cs
- PointKeyFrameCollection.cs
- HttpHandlersSection.cs
- QuaternionRotation3D.cs
- StreamReader.cs
- ExpressionEditor.cs
- processwaithandle.cs
- SortableBindingList.cs
- EntityRecordInfo.cs
- RequestQueryProcessor.cs
- CloudCollection.cs
- AppSettingsReader.cs
- QueryStringParameter.cs
- ProcessHostMapPath.cs
- WindowsSpinner.cs
- WindowsGrip.cs
- FacetValues.cs
- PkcsUtils.cs
- Italic.cs
- ScrollableControl.cs
- IConvertible.cs
- SelectorItemAutomationPeer.cs
- GeneralTransform2DTo3DTo2D.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- InstanceCreationEditor.cs
- RelationshipNavigation.cs
- LocalTransaction.cs
- DesignerOptions.cs
- PermissionAttributes.cs
- ProofTokenCryptoHandle.cs
- PartialList.cs
- IBuiltInEvidence.cs
- InvalidPropValue.cs
- FontClient.cs
- _DisconnectOverlappedAsyncResult.cs
- Converter.cs
- _NegotiateClient.cs
- BodyGlyph.cs
- EventManager.cs
- CqlLexerHelpers.cs
- HebrewCalendar.cs