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
- querybuilder.cs
- TargetInvocationException.cs
- ClientProxyGenerator.cs
- FontNameEditor.cs
- SafeNativeMethods.cs
- XmlTextAttribute.cs
- ZipIOExtraFieldPaddingElement.cs
- DataRowComparer.cs
- DataGridViewComboBoxCell.cs
- ResourceExpressionBuilder.cs
- TailCallAnalyzer.cs
- RelationshipDetailsRow.cs
- DataControlButton.cs
- Connector.xaml.cs
- ObjectNotFoundException.cs
- ZoneLinkButton.cs
- CheckBoxField.cs
- _AcceptOverlappedAsyncResult.cs
- Encoder.cs
- DnsPermission.cs
- ImpersonateTokenRef.cs
- InterleavedZipPartStream.cs
- ObjectConverter.cs
- HttpStreamMessage.cs
- DesignTimeVisibleAttribute.cs
- FigureParagraph.cs
- SqlMethods.cs
- DataSet.cs
- MouseEvent.cs
- COM2IDispatchConverter.cs
- HostedBindingBehavior.cs
- Lazy.cs
- ResourceDescriptionAttribute.cs
- RequestDescription.cs
- AggregateException.cs
- WebPartConnectionsCancelEventArgs.cs
- DataGridRelationshipRow.cs
- PropertyInformationCollection.cs
- BindingContext.cs
- EntitySqlQueryCacheKey.cs
- OverflowException.cs
- MergeEnumerator.cs
- ObjectItemNoOpAssemblyLoader.cs
- PropertyItem.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- DrawingDrawingContext.cs
- InputLanguage.cs
- PreservationFileWriter.cs
- AutomationProperties.cs
- DocumentAutomationPeer.cs
- SecureUICommand.cs
- ScopelessEnumAttribute.cs
- SoapDocumentMethodAttribute.cs
- DbParameterHelper.cs
- KeyboardEventArgs.cs
- OleDbStruct.cs
- RemoteAsymmetricSignatureFormatter.cs
- DocumentOrderQuery.cs
- BulletedListEventArgs.cs
- OrderByBuilder.cs
- EventSetter.cs
- BamlVersionHeader.cs
- DelegatingTypeDescriptionProvider.cs
- Mapping.cs
- EntityChangedParams.cs
- NCryptSafeHandles.cs
- DataGrid.cs
- RecordManager.cs
- ZipIOLocalFileHeader.cs
- CharEntityEncoderFallback.cs
- NativeMethods.cs
- ErrorHandler.cs
- infer.cs
- InfoCardKeyedHashAlgorithm.cs
- ToolboxComponentsCreatingEventArgs.cs
- Color.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- CustomErrorCollection.cs
- RangeValueProviderWrapper.cs
- XmlBaseReader.cs
- MediaPlayerState.cs
- UniformGrid.cs
- OutputScopeManager.cs
- AssemblyNameProxy.cs
- IMembershipProvider.cs
- PostBackOptions.cs
- AsyncResult.cs
- TemplateParser.cs
- BitmapDownload.cs
- SettingsPropertyNotFoundException.cs
- HtmlSelect.cs
- httpapplicationstate.cs
- remotingproxy.cs
- RowUpdatedEventArgs.cs
- ConfigXmlCDataSection.cs
- DataGridItemAutomationPeer.cs
- Clause.cs
- ResourceCategoryAttribute.cs
- PointKeyFrameCollection.cs
- ServiceParser.cs