Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- FunctionNode.cs
- MemberProjectedSlot.cs
- ClientProxyGenerator.cs
- String.cs
- Table.cs
- ResXFileRef.cs
- RuleRefElement.cs
- ExtenderProvidedPropertyAttribute.cs
- XpsColorContext.cs
- GCHandleCookieTable.cs
- FontUnitConverter.cs
- RtfControls.cs
- DocumentCollection.cs
- UInt64Converter.cs
- CellTreeNodeVisitors.cs
- SafeReversePInvokeHandle.cs
- WebPartConnectionsConfigureVerb.cs
- XmlQueryContext.cs
- TransformedBitmap.cs
- ConfigXmlCDataSection.cs
- sitestring.cs
- PermissionToken.cs
- KeyValueInternalCollection.cs
- NewExpression.cs
- HttpHandlersSection.cs
- MatrixStack.cs
- NativeObjectSecurity.cs
- TextWriterEngine.cs
- BezierSegment.cs
- SqlTypeConverter.cs
- CompModSwitches.cs
- DiagnosticsConfigurationHandler.cs
- IconConverter.cs
- LinqDataSourceUpdateEventArgs.cs
- CodeAssignStatement.cs
- WindowClosedEventArgs.cs
- MatrixCamera.cs
- Hashtable.cs
- FontStyle.cs
- EntityDataSourceColumn.cs
- DataMisalignedException.cs
- PolygonHotSpot.cs
- SrgsSubset.cs
- Row.cs
- ListControlConvertEventArgs.cs
- HtmlToClrEventProxy.cs
- GenericEnumConverter.cs
- OperatorExpressions.cs
- TemplateInstanceAttribute.cs
- PropertyEmitterBase.cs
- PageAction.cs
- Interlocked.cs
- SqlDataSourceQuery.cs
- ConfigsHelper.cs
- StringStorage.cs
- RoleService.cs
- ExtensionFile.cs
- StrongNamePublicKeyBlob.cs
- OperationFormatter.cs
- TraceProvider.cs
- RawUIStateInputReport.cs
- WebPartUserCapability.cs
- ShapingEngine.cs
- CompilationRelaxations.cs
- StylusEventArgs.cs
- ContentValidator.cs
- ListView.cs
- SafeFileHandle.cs
- ProviderUtil.cs
- Errors.cs
- Nullable.cs
- GridViewRowEventArgs.cs
- ECDiffieHellmanPublicKey.cs
- PropertyDescriptor.cs
- UserInitiatedRoutedEventPermission.cs
- ForeignKeyConstraint.cs
- Signature.cs
- SystemDropShadowChrome.cs
- ObjectItemAssemblyLoader.cs
- ComponentSerializationService.cs
- FixUpCollection.cs
- LineInfo.cs
- BitmapSource.cs
- ContentType.cs
- BigInt.cs
- FocusTracker.cs
- BlockCollection.cs
- UriSection.cs
- ScrollBarRenderer.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- CopyAction.cs
- Currency.cs
- ViewManager.cs
- CodeRemoveEventStatement.cs
- WindowsFormsLinkLabel.cs
- IdnMapping.cs
- FormatterConverter.cs
- _CacheStreams.cs
- FlowLayoutSettings.cs
- PowerModeChangedEventArgs.cs