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
- EtwProvider.cs
- HashMembershipCondition.cs
- ChildTable.cs
- SwitchLevelAttribute.cs
- DynamicControlParameter.cs
- MenuItemBinding.cs
- TaskDesigner.cs
- SafeSecurityHandles.cs
- VectorAnimationUsingKeyFrames.cs
- Html32TextWriter.cs
- counter.cs
- SchemaNames.cs
- CompilationLock.cs
- HybridWebProxyFinder.cs
- RequestCachingSection.cs
- ScopelessEnumAttribute.cs
- AssemblyHelper.cs
- TimeSpanStorage.cs
- AspNetHostingPermission.cs
- EncryptedKey.cs
- PartBasedPackageProperties.cs
- MessageBox.cs
- GridViewCellAutomationPeer.cs
- ProviderSettings.cs
- BinaryFormatterWriter.cs
- InProcStateClientManager.cs
- MimeTypeMapper.cs
- ClockController.cs
- MLangCodePageEncoding.cs
- FieldBuilder.cs
- ObjectKeyFrameCollection.cs
- BeginCreateSecurityTokenRequest.cs
- AttachmentService.cs
- WorkflowItemPresenter.cs
- HandleExceptionArgs.cs
- Pkcs7Recipient.cs
- TailCallAnalyzer.cs
- ISAPIApplicationHost.cs
- GreenMethods.cs
- RectIndependentAnimationStorage.cs
- PeerEndPoint.cs
- NamespaceListProperty.cs
- InheritanceAttribute.cs
- DataViewSettingCollection.cs
- CapabilitiesPattern.cs
- ToolStripPanel.cs
- Row.cs
- CompilerError.cs
- DependencyPropertyChangedEventArgs.cs
- XmlHelper.cs
- Button.cs
- BaseComponentEditor.cs
- WebControlToolBoxItem.cs
- FrameDimension.cs
- XmlSerializationGeneratedCode.cs
- XmlSchemaSimpleContent.cs
- TimerElapsedEvenArgs.cs
- SpellerStatusTable.cs
- CloseSequenceResponse.cs
- WCFServiceClientProxyGenerator.cs
- MediaPlayer.cs
- PermissionToken.cs
- CqlErrorHelper.cs
- AssemblyUtil.cs
- BatchStream.cs
- ErrorStyle.cs
- LiteralSubsegment.cs
- TemplateXamlParser.cs
- ObjectAnimationUsingKeyFrames.cs
- GridEntryCollection.cs
- BoolExpressionVisitors.cs
- ProcessManager.cs
- WebBodyFormatMessageProperty.cs
- DesignerActionUI.cs
- SafeNativeMethodsCLR.cs
- PermissionAttributes.cs
- DispatcherHookEventArgs.cs
- PerfCounterSection.cs
- StorageMappingItemCollection.cs
- BinHexDecoder.cs
- ToolStripOverflow.cs
- DelayDesigner.cs
- ClientRoleProvider.cs
- ObjectAnimationUsingKeyFrames.cs
- EUCJPEncoding.cs
- UnaryNode.cs
- CoreSwitches.cs
- ResourcePermissionBase.cs
- Matrix3D.cs
- DataGridHeaderBorder.cs
- DataGridViewBand.cs
- SafeReversePInvokeHandle.cs
- ApplicationDirectoryMembershipCondition.cs
- DBCommand.cs
- MULTI_QI.cs
- CodeTypeMember.cs
- ScrollBarRenderer.cs
- XmlSequenceWriter.cs
- Aggregates.cs
- ChoiceConverter.cs