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
- ProcessInfo.cs
- WindowsListViewItemStartMenu.cs
- WebPartMovingEventArgs.cs
- NullableIntMinMaxAggregationOperator.cs
- ResXBuildProvider.cs
- PtsHelper.cs
- Rotation3DKeyFrameCollection.cs
- arabicshape.cs
- CommandPlan.cs
- HtmlUtf8RawTextWriter.cs
- CompleteWizardStep.cs
- DesignerTransaction.cs
- PreservationFileWriter.cs
- MemoryFailPoint.cs
- SessionMode.cs
- PropertyKey.cs
- RangeValidator.cs
- Geometry3D.cs
- OptimizedTemplateContentHelper.cs
- FilterElement.cs
- PageVisual.cs
- SaveFileDialogDesigner.cs
- WebPartConnectionCollection.cs
- EntityStoreSchemaGenerator.cs
- AttributeCollection.cs
- Dynamic.cs
- MaskInputRejectedEventArgs.cs
- DbParameterCollection.cs
- SpecialFolderEnumConverter.cs
- ExpressionLink.cs
- MobileFormsAuthentication.cs
- WebUtil.cs
- NegotiateStream.cs
- Environment.cs
- StructuralComparisons.cs
- ProviderConnectionPointCollection.cs
- OrderByQueryOptionExpression.cs
- SamlSerializer.cs
- PathSegment.cs
- TaskFileService.cs
- VirtualizingPanel.cs
- diagnosticsswitches.cs
- TextViewSelectionProcessor.cs
- DateTimeOffsetStorage.cs
- PerformanceCounterPermission.cs
- Point3DCollectionConverter.cs
- CodeTypeDelegate.cs
- XmlSerializerNamespaces.cs
- serverconfig.cs
- WebPartHeaderCloseVerb.cs
- DataListGeneralPage.cs
- CompositeFontFamily.cs
- XmlText.cs
- CfgParser.cs
- x509utils.cs
- DockPattern.cs
- BufferModeSettings.cs
- FillBehavior.cs
- CapabilitiesState.cs
- WindowsRebar.cs
- FixedBufferAttribute.cs
- TreeIterator.cs
- TrackingMemoryStream.cs
- SecureUICommand.cs
- ADMembershipUser.cs
- Constants.cs
- ConfigUtil.cs
- DebuggerAttributes.cs
- _AutoWebProxyScriptHelper.cs
- BridgeDataRecord.cs
- ModuleBuilder.cs
- PropertyEntry.cs
- LinkLabel.cs
- UserMapPath.cs
- JsonQNameDataContract.cs
- PKCS1MaskGenerationMethod.cs
- RegexCharClass.cs
- ObjectDataSource.cs
- ThreadStaticAttribute.cs
- ContainerUtilities.cs
- VariableQuery.cs
- TagPrefixAttribute.cs
- DesignerSerializerAttribute.cs
- WindowsEditBox.cs
- UdpDuplexChannel.cs
- ObjectQueryExecutionPlan.cs
- Update.cs
- HierarchicalDataBoundControlAdapter.cs
- PublisherIdentityPermission.cs
- XmlCharCheckingReader.cs
- ScriptHandlerFactory.cs
- ParentQuery.cs
- VisualBrush.cs
- DefinitionBase.cs
- MetadataUtilsSmi.cs
- ObjectParameter.cs
- OAVariantLib.cs
- PriorityQueue.cs
- TreeViewEvent.cs
- DLinqColumnProvider.cs