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
- _NetworkingPerfCounters.cs
- DropSource.cs
- Pair.cs
- ValidationUtility.cs
- PolicyStatement.cs
- LightweightCodeGenerator.cs
- RelationshipType.cs
- InternalConfigConfigurationFactory.cs
- SeekStoryboard.cs
- ReachBasicContext.cs
- XslNumber.cs
- lengthconverter.cs
- EntityProviderServices.cs
- ConversionValidationRule.cs
- OperatingSystem.cs
- EntityTypeEmitter.cs
- AuthenticationModulesSection.cs
- TextRangeProviderWrapper.cs
- GeneralTransform2DTo3D.cs
- COM2IDispatchConverter.cs
- SecureConversationServiceElement.cs
- Timer.cs
- ImageSourceValueSerializer.cs
- CodeLinePragma.cs
- TypeConverterAttribute.cs
- RequestResponse.cs
- ThreadLocal.cs
- VisualTreeHelper.cs
- EnvironmentPermission.cs
- IODescriptionAttribute.cs
- AttributeUsageAttribute.cs
- EpmCustomContentDeSerializer.cs
- DistinctQueryOperator.cs
- XDeferredAxisSource.cs
- OdbcEnvironment.cs
- AutoSizeToolBoxItem.cs
- DragDeltaEventArgs.cs
- ToolBarButton.cs
- ContextActivityUtils.cs
- ItemCollection.cs
- DataKey.cs
- XmlMtomWriter.cs
- ConfigurationElementProperty.cs
- PrimitiveType.cs
- SystemException.cs
- MonthChangedEventArgs.cs
- ObjectStateFormatter.cs
- DriveNotFoundException.cs
- HwndSubclass.cs
- DiagnosticTrace.cs
- Decoder.cs
- PreservationFileReader.cs
- TypeConvertions.cs
- BamlResourceDeserializer.cs
- Int16KeyFrameCollection.cs
- TitleStyle.cs
- HybridDictionary.cs
- PeerNameRegistration.cs
- ReadOnlyNameValueCollection.cs
- SqlParameter.cs
- X509ServiceCertificateAuthentication.cs
- ComNativeDescriptor.cs
- ApplicationInfo.cs
- AttributeProviderAttribute.cs
- StylusButton.cs
- CodeAssignStatement.cs
- _KerberosClient.cs
- SystemIcmpV4Statistics.cs
- VisualTarget.cs
- WCFServiceClientProxyGenerator.cs
- GridViewRow.cs
- NullRuntimeConfig.cs
- _Connection.cs
- AuthStoreRoleProvider.cs
- RadioButtonFlatAdapter.cs
- ExportOptions.cs
- ReliableReplySessionChannel.cs
- TextRenderer.cs
- AccessibilityHelperForVista.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- FontDriver.cs
- WindowsEditBox.cs
- FixedSOMImage.cs
- ManipulationInertiaStartingEventArgs.cs
- FileDialogCustomPlaces.cs
- MenuCommands.cs
- ImageButton.cs
- _AcceptOverlappedAsyncResult.cs
- SafeUserTokenHandle.cs
- SqlDataReaderSmi.cs
- MouseButton.cs
- ServiceModelConfiguration.cs
- unsafenativemethodsother.cs
- ExpressionEditor.cs
- ThreadLocal.cs
- GeometryGroup.cs
- TagPrefixInfo.cs
- DateTimeParse.cs
- SchemaImporterExtensionsSection.cs
- login.cs