Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Matrix.cs
- WebPartEventArgs.cs
- DriveNotFoundException.cs
- metadatamappinghashervisitor.cs
- FlatButtonAppearance.cs
- InstanceLockException.cs
- CodeGotoStatement.cs
- ScrollPatternIdentifiers.cs
- UnauthorizedAccessException.cs
- externdll.cs
- ConnectionPoint.cs
- CodeDomSerializerException.cs
- DropShadowEffect.cs
- QuotaThrottle.cs
- ToolStrip.cs
- EpmSourceTree.cs
- WebHttpBindingCollectionElement.cs
- CleanUpVirtualizedItemEventArgs.cs
- DataObjectAttribute.cs
- IOThreadTimer.cs
- ObjectSecurity.cs
- TextChangedEventArgs.cs
- SizeChangedEventArgs.cs
- JsonWriter.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- PropertyGroupDescription.cs
- EntityUtil.cs
- CryptoKeySecurity.cs
- CodeGen.cs
- BackStopAuthenticationModule.cs
- ViewValidator.cs
- XamlFilter.cs
- _SingleItemRequestCache.cs
- DocumentPaginator.cs
- EmptyTextWriter.cs
- BaseHashHelper.cs
- TreeBuilderBamlTranslator.cs
- RequestSecurityTokenResponse.cs
- SapiRecoContext.cs
- LZCodec.cs
- DiscreteKeyFrames.cs
- PathSegmentCollection.cs
- ExpandCollapsePattern.cs
- DesignTimeVisibleAttribute.cs
- ValidationError.cs
- HtmlButton.cs
- ColorBlend.cs
- DbParameterHelper.cs
- DependencyPropertyChangedEventArgs.cs
- StatusBarPanel.cs
- ReaderWriterLock.cs
- SerializationFieldInfo.cs
- AppendHelper.cs
- DispatcherHooks.cs
- Error.cs
- RadioButton.cs
- TreeViewCancelEvent.cs
- PreProcessInputEventArgs.cs
- WsatConfiguration.cs
- ScalarOps.cs
- TagMapInfo.cs
- ScaleTransform3D.cs
- Itemizer.cs
- TableChangeProcessor.cs
- RadioButtonList.cs
- HtmlHistory.cs
- PeerApplication.cs
- TransformerConfigurationWizardBase.cs
- ListBoxAutomationPeer.cs
- Part.cs
- DtdParser.cs
- ImageSource.cs
- EventMappingSettingsCollection.cs
- DesignerActionUI.cs
- ObjectConverter.cs
- EllipseGeometry.cs
- StoragePropertyMapping.cs
- AlternationConverter.cs
- ButtonPopupAdapter.cs
- Event.cs
- XPathDocumentBuilder.cs
- FrameworkElementAutomationPeer.cs
- SecurityCriticalDataForSet.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- HeaderedContentControl.cs
- DBCSCodePageEncoding.cs
- EventLogPermissionHolder.cs
- KnownColorTable.cs
- ConstructorNeedsTagAttribute.cs
- XmlSchemaAnnotated.cs
- ContactManager.cs
- CompositeFontFamily.cs
- ImageMapEventArgs.cs
- CounterCreationDataCollection.cs
- Compiler.cs
- SecurityHelper.cs
- LogLogRecord.cs
- TreeBuilderXamlTranslator.cs
- HealthMonitoringSectionHelper.cs
- DesignerLoader.cs