Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Configuration / System / Configuration / StringValidatorAttribute.cs / 1 / StringValidatorAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Configuration.Internal; using System.Collections; using System.Collections.Specialized; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Security.Permissions; using System.Xml; using System.Globalization; using System.ComponentModel; using System.Security; using System.Text; namespace System.Configuration { [AttributeUsage(AttributeTargets.Property)] public sealed class StringValidatorAttribute : ConfigurationValidatorAttribute { private int _minLength = 0; private int _maxLength = int.MaxValue; private string _invalidChars; public StringValidatorAttribute() { } public override ConfigurationValidatorBase ValidatorInstance { get { return new StringValidator(_minLength, _maxLength, _invalidChars); } } public int MinLength { get { return _minLength; } set { if (_maxLength < value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _minLength = value; } } public int MaxLength { get { return _maxLength; } set { if (_minLength > value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _maxLength = value; } } public string InvalidCharacters { get { return _invalidChars; } set { _invalidChars = value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Configuration.Internal; using System.Collections; using System.Collections.Specialized; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Security.Permissions; using System.Xml; using System.Globalization; using System.ComponentModel; using System.Security; using System.Text; namespace System.Configuration { [AttributeUsage(AttributeTargets.Property)] public sealed class StringValidatorAttribute : ConfigurationValidatorAttribute { private int _minLength = 0; private int _maxLength = int.MaxValue; private string _invalidChars; public StringValidatorAttribute() { } public override ConfigurationValidatorBase ValidatorInstance { get { return new StringValidator(_minLength, _maxLength, _invalidChars); } } public int MinLength { get { return _minLength; } set { if (_maxLength < value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _minLength = value; } } public int MaxLength { get { return _maxLength; } set { if (_minLength > value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _maxLength = value; } } public string InvalidCharacters { get { return _invalidChars; } set { _invalidChars = value; } } } } // 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
- XmlSchemaAnnotation.cs
- SectionVisual.cs
- UrlMappingCollection.cs
- XmlNavigatorStack.cs
- XPathItem.cs
- ParentUndoUnit.cs
- MexBindingElement.cs
- Label.cs
- CopyAction.cs
- RectAnimationClockResource.cs
- ConstructorArgumentAttribute.cs
- DataGridState.cs
- MenuCommands.cs
- NullReferenceException.cs
- ResponseBodyWriter.cs
- SqlSupersetValidator.cs
- ObjectStateFormatter.cs
- SerializableAttribute.cs
- Mapping.cs
- ModuleBuilderData.cs
- HashMembershipCondition.cs
- EntityContainerAssociationSetEnd.cs
- Operand.cs
- HitTestFilterBehavior.cs
- Permission.cs
- QilBinary.cs
- ConfigurationSchemaErrors.cs
- baseaxisquery.cs
- XmlSchemaAppInfo.cs
- BinaryMessageFormatter.cs
- RecognizerInfo.cs
- FusionWrap.cs
- WebHttpSecurityElement.cs
- ItemContainerProviderWrapper.cs
- MatrixStack.cs
- EmptyQuery.cs
- PixelShader.cs
- SchemaNamespaceManager.cs
- HttpWebResponse.cs
- XamlToRtfWriter.cs
- DesignRelation.cs
- SchemaImporter.cs
- CodeDOMProvider.cs
- LabelLiteral.cs
- ToolboxDataAttribute.cs
- ResourceDefaultValueAttribute.cs
- ListItem.cs
- ProcessInfo.cs
- shaperfactory.cs
- CallSiteBinder.cs
- ResizeGrip.cs
- DataReaderContainer.cs
- CssClassPropertyAttribute.cs
- metadatamappinghashervisitor.cs
- AppModelKnownContentFactory.cs
- PreloadedPackages.cs
- MetadataProperty.cs
- Rect3DValueSerializer.cs
- ControlIdConverter.cs
- WebPartMovingEventArgs.cs
- SizeAnimationClockResource.cs
- FSWPathEditor.cs
- RegisteredDisposeScript.cs
- DispatchOperation.cs
- TextRenderer.cs
- DataGridTablesFactory.cs
- EpmContentSerializer.cs
- NamespaceEmitter.cs
- ReceiveMessageRecord.cs
- EntityCommandDefinition.cs
- ColorMatrix.cs
- TreeNodeBindingCollection.cs
- DurationConverter.cs
- FeatureSupport.cs
- DispatcherSynchronizationContext.cs
- AccessibleObject.cs
- WebResourceUtil.cs
- SerializationStore.cs
- PtsContext.cs
- AttributeProviderAttribute.cs
- AccessorTable.cs
- ImageMapEventArgs.cs
- AdPostCacheSubstitution.cs
- ContentPosition.cs
- Baml2006SchemaContext.cs
- InvalidateEvent.cs
- BindingManagerDataErrorEventArgs.cs
- UpdatePanelTrigger.cs
- RequestNavigateEventArgs.cs
- VisualStyleInformation.cs
- backend.cs
- TreeNodeStyle.cs
- SortDescriptionCollection.cs
- WebPageTraceListener.cs
- RightsManagementInformation.cs
- WebScriptMetadataMessageEncoderFactory.cs
- SimpleHandlerFactory.cs
- BamlVersionHeader.cs
- BackgroundFormatInfo.cs
- IInstanceContextProvider.cs