Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- HighContrastHelper.cs
- ConfigsHelper.cs
- SyntaxCheck.cs
- RootBrowserWindow.cs
- SafeTokenHandle.cs
- JsonWriter.cs
- MeshGeometry3D.cs
- RenderDataDrawingContext.cs
- TextEditorSpelling.cs
- TransactionChannel.cs
- Delegate.cs
- IInstanceTable.cs
- Token.cs
- ChildTable.cs
- LinearQuaternionKeyFrame.cs
- ErrorInfoXmlDocument.cs
- URLAttribute.cs
- ISessionStateStore.cs
- WebBrowser.cs
- ACE.cs
- X509SecurityTokenProvider.cs
- SafeSystemMetrics.cs
- DocumentViewer.cs
- RSAOAEPKeyExchangeDeformatter.cs
- DataSourceSelectArguments.cs
- WsatExtendedInformation.cs
- backend.cs
- PrimaryKeyTypeConverter.cs
- XamlRtfConverter.cs
- CodeParameterDeclarationExpression.cs
- SHA512.cs
- TransformCollection.cs
- Errors.cs
- BoundColumn.cs
- TemplateComponentConnector.cs
- GridViewRowCollection.cs
- HttpConfigurationContext.cs
- InlineUIContainer.cs
- PropertyGeneratedEventArgs.cs
- DictionaryMarkupSerializer.cs
- CodeTypeConstructor.cs
- ScrollBarRenderer.cs
- XmlSchemaAnnotation.cs
- EdmProperty.cs
- HtmlTableCell.cs
- RequestCache.cs
- ForwardPositionQuery.cs
- ListItemConverter.cs
- _KerberosClient.cs
- DataGridView.cs
- WebPartAddingEventArgs.cs
- KnownTypes.cs
- TcpTransportElement.cs
- EventSinkHelperWriter.cs
- IriParsingElement.cs
- RootProjectionNode.cs
- AssociatedControlConverter.cs
- SafeNativeMethodsOther.cs
- LayoutEvent.cs
- ExtendedTransformFactory.cs
- diagnosticsswitches.cs
- AttributedMetaModel.cs
- InvalidateEvent.cs
- IPAddress.cs
- TraceSwitch.cs
- SiteMapSection.cs
- CharAnimationBase.cs
- ServiceHostFactory.cs
- DbMetaDataColumnNames.cs
- InternalPermissions.cs
- X509Certificate2Collection.cs
- UniqueTransportManagerRegistration.cs
- EntityTypeEmitter.cs
- AuthenticatingEventArgs.cs
- RolePrincipal.cs
- MenuTracker.cs
- SamlAttribute.cs
- TraceUtility.cs
- MenuCommand.cs
- KeySplineConverter.cs
- DesignerInterfaces.cs
- MoveSizeWinEventHandler.cs
- UxThemeWrapper.cs
- WebHttpBindingElement.cs
- COAUTHINFO.cs
- Attributes.cs
- SqlServer2KCompatibilityCheck.cs
- EntityTypeEmitter.cs
- FormView.cs
- Viewport2DVisual3D.cs
- DropDownList.cs
- PointLightBase.cs
- SqlDataSourceStatusEventArgs.cs
- StructuredTypeInfo.cs
- EntityClientCacheKey.cs
- FunctionDescription.cs
- InkCanvas.cs
- ItemAutomationPeer.cs
- WebBrowserHelper.cs
- ContentDesigner.cs