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
- ConfigurationManager.cs
- GeneratedView.cs
- ExceptionValidationRule.cs
- JsonByteArrayDataContract.cs
- OdbcEnvironmentHandle.cs
- Window.cs
- IChannel.cs
- MenuItem.cs
- TokenizerHelper.cs
- FrameworkReadOnlyPropertyMetadata.cs
- JavaScriptString.cs
- TextRangeAdaptor.cs
- ObjectDataSourceDisposingEventArgs.cs
- ConnectionPoolManager.cs
- WindowsIdentity.cs
- NativeMethods.cs
- StateChangeEvent.cs
- _ProxyRegBlob.cs
- StylusSystemGestureEventArgs.cs
- ConfigurationPropertyCollection.cs
- PeerMessageDispatcher.cs
- SemanticBasicElement.cs
- ColorTranslator.cs
- xml.cs
- ResizingMessageFilter.cs
- CompleteWizardStep.cs
- HttpCookieCollection.cs
- DashStyle.cs
- Condition.cs
- Point.cs
- TextAction.cs
- StylusPlugin.cs
- DoubleAnimationBase.cs
- Group.cs
- IssuanceLicense.cs
- SettingsPropertyValueCollection.cs
- ProfileGroupSettings.cs
- CaseStatementSlot.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- DetailsViewInsertedEventArgs.cs
- ByteAnimation.cs
- Literal.cs
- CommonObjectSecurity.cs
- DateTimeParse.cs
- SystemException.cs
- TagPrefixInfo.cs
- WriteFileContext.cs
- CreateUserWizardStep.cs
- QueryAsyncResult.cs
- ScrollViewer.cs
- RegularExpressionValidator.cs
- ProtocolViolationException.cs
- basevalidator.cs
- TextBox.cs
- MobileTextWriter.cs
- MetadataItemEmitter.cs
- GroupBox.cs
- FixedDocument.cs
- HandledEventArgs.cs
- RIPEMD160.cs
- OdbcParameterCollection.cs
- HttpModulesInstallComponent.cs
- Manipulation.cs
- FolderBrowserDialog.cs
- MiniAssembly.cs
- IntellisenseTextBox.cs
- RightsManagementErrorHandler.cs
- ApplicationSecurityManager.cs
- SQLResource.cs
- Double.cs
- DataTableTypeConverter.cs
- SingleKeyFrameCollection.cs
- GuidConverter.cs
- WebBrowserUriTypeConverter.cs
- Vector3DAnimationUsingKeyFrames.cs
- Soap.cs
- DefaultSerializationProviderAttribute.cs
- SubqueryRules.cs
- ToolStripDropDownItem.cs
- COM2TypeInfoProcessor.cs
- PropertyToken.cs
- User.cs
- DbParameterCollectionHelper.cs
- QueuePathEditor.cs
- dtdvalidator.cs
- AnnotationDocumentPaginator.cs
- GeneralTransform2DTo3D.cs
- ReachVisualSerializerAsync.cs
- DoubleLink.cs
- TypedTableBase.cs
- CompositionAdorner.cs
- ToolBarOverflowPanel.cs
- ProgressBarHighlightConverter.cs
- CodeTypeMemberCollection.cs
- ChangeConflicts.cs
- RoleGroup.cs
- DbProviderManifest.cs
- XsltSettings.cs
- UrlAuthFailedErrorFormatter.cs
- DurationConverter.cs