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
- Label.cs
- xml.cs
- XmlHierarchicalDataSourceView.cs
- TextMessageEncoder.cs
- FormViewInsertEventArgs.cs
- XmlWriterTraceListener.cs
- Win32.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ArithmeticException.cs
- TypeNameConverter.cs
- InvokeMethodActivity.cs
- EarlyBoundInfo.cs
- CroppedBitmap.cs
- Rect3D.cs
- ResourcesBuildProvider.cs
- SelectionEditingBehavior.cs
- TreeNodeStyleCollection.cs
- SafeEventLogReadHandle.cs
- DateTimeValueSerializerContext.cs
- RijndaelManaged.cs
- GridSplitter.cs
- DeviceContexts.cs
- SafeSecurityHandles.cs
- SingleResultAttribute.cs
- SecurityAlgorithmSuiteConverter.cs
- WriteTimeStream.cs
- StringValueSerializer.cs
- LicenseManager.cs
- Model3DGroup.cs
- AsmxEndpointPickerExtension.cs
- DataBoundLiteralControl.cs
- SignedPkcs7.cs
- UIServiceHelper.cs
- XappLauncher.cs
- Viewport3DAutomationPeer.cs
- MetadataFile.cs
- EmbeddedMailObject.cs
- ChangeNode.cs
- RegistryDataKey.cs
- Page.cs
- OutputScope.cs
- TextChangedEventArgs.cs
- Model3DGroup.cs
- DataGridViewRowsAddedEventArgs.cs
- ActiveXHost.cs
- HttpListenerPrefixCollection.cs
- CustomAttributeBuilder.cs
- LineVisual.cs
- FlowLayoutPanel.cs
- FormViewRow.cs
- IdentityHolder.cs
- SmtpNtlmAuthenticationModule.cs
- Style.cs
- TextEffectResolver.cs
- MachineSettingsSection.cs
- SafeNativeMethods.cs
- EmptyReadOnlyDictionaryInternal.cs
- FormViewModeEventArgs.cs
- SiteMapNodeItem.cs
- StyleModeStack.cs
- SerialStream.cs
- HtmlMeta.cs
- ConnectionConsumerAttribute.cs
- SystemIPv4InterfaceProperties.cs
- CryptographicAttribute.cs
- SyndicationDeserializer.cs
- HMACSHA256.cs
- IChannel.cs
- ChildTable.cs
- Adorner.cs
- PrimitiveRenderer.cs
- TaskExceptionHolder.cs
- CodeGotoStatement.cs
- DiagnosticsConfigurationHandler.cs
- LambdaExpression.cs
- ControlPropertyNameConverter.cs
- CTreeGenerator.cs
- CngAlgorithm.cs
- ConnectionManagementElement.cs
- GifBitmapDecoder.cs
- EntitySetDataBindingList.cs
- EnumerableRowCollectionExtensions.cs
- InputLanguageEventArgs.cs
- XmlMtomWriter.cs
- StringValidator.cs
- IdentityModelDictionary.cs
- DllHostInitializer.cs
- SelectionHighlightInfo.cs
- SendMailErrorEventArgs.cs
- CatalogPartCollection.cs
- PropertyInfoSet.cs
- LoginDesigner.cs
- ObjectItemCachedAssemblyLoader.cs
- XmlSchemaAll.cs
- ListBase.cs
- DynamicVirtualDiscoSearcher.cs
- TransactionsSectionGroup.cs
- AlphabeticalEnumConverter.cs
- AssemblyBuilderData.cs
- PlaceHolder.cs