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
- SqlConnectionPoolProviderInfo.cs
- Margins.cs
- AutomationElementIdentifiers.cs
- ArrayTypeMismatchException.cs
- SystemResources.cs
- DataGridLinkButton.cs
- UnsafeNativeMethods.cs
- RelationshipConverter.cs
- DesignerActionService.cs
- ScrollItemProviderWrapper.cs
- XmlAttributeAttribute.cs
- XamlSerializer.cs
- InvalidCommandTreeException.cs
- TransactionManager.cs
- DataGridViewButtonCell.cs
- Style.cs
- ScrollChrome.cs
- JapaneseLunisolarCalendar.cs
- _LazyAsyncResult.cs
- FormsAuthenticationEventArgs.cs
- InlineCollection.cs
- DoubleLinkListEnumerator.cs
- EditCommandColumn.cs
- UniformGrid.cs
- WindowsRebar.cs
- TagPrefixCollection.cs
- RootAction.cs
- WebPartCatalogCloseVerb.cs
- GuidelineSet.cs
- ReferentialConstraintRoleElement.cs
- ReadOnlyHierarchicalDataSource.cs
- TypeGenericEnumerableViewSchema.cs
- ObjectToken.cs
- ContextBase.cs
- NamedElement.cs
- TextBreakpoint.cs
- ParentUndoUnit.cs
- ExeContext.cs
- ValueProviderWrapper.cs
- ChildChangedEventArgs.cs
- CompositeScriptReferenceEventArgs.cs
- RoutedUICommand.cs
- DBCSCodePageEncoding.cs
- InkCanvasInnerCanvas.cs
- FocusManager.cs
- PropertyBuilder.cs
- ToolStripHighContrastRenderer.cs
- Or.cs
- BezierSegment.cs
- XmlSchemaSimpleTypeList.cs
- RangeBaseAutomationPeer.cs
- InfiniteTimeSpanConverter.cs
- CellRelation.cs
- BrowserCapabilitiesCompiler.cs
- XmlDocumentFragment.cs
- SqlCharStream.cs
- BuildResultCache.cs
- FlowDocumentPageViewerAutomationPeer.cs
- FormatConvertedBitmap.cs
- BooleanToVisibilityConverter.cs
- SystemException.cs
- XPathItem.cs
- QilInvoke.cs
- MessageAction.cs
- Compiler.cs
- PerformanceCounterPermissionEntry.cs
- ImageKeyConverter.cs
- CharacterString.cs
- InvalidCommandTreeException.cs
- ZipIOCentralDirectoryBlock.cs
- LogSwitch.cs
- XmlDomTextWriter.cs
- MailSettingsSection.cs
- PerformanceCounterPermissionAttribute.cs
- SqlBuilder.cs
- ChannelManager.cs
- EmulateRecognizeCompletedEventArgs.cs
- ConfigurationProperty.cs
- InplaceBitmapMetadataWriter.cs
- SmtpClient.cs
- AuthorizationRule.cs
- DbMetaDataCollectionNames.cs
- SystemFonts.cs
- TabControlEvent.cs
- Brush.cs
- RuntimeWrappedException.cs
- HitTestFilterBehavior.cs
- PerformanceCounterManager.cs
- DocumentViewerHelper.cs
- SizeAnimationUsingKeyFrames.cs
- SendParametersContent.cs
- MessageFormatterConverter.cs
- StrokeSerializer.cs
- WebPartDisplayMode.cs
- RegisteredDisposeScript.cs
- HtmlTableRowCollection.cs
- SpecialFolderEnumConverter.cs
- DesignerLabelAdapter.cs
- CroppedBitmap.cs
- InvalidOperationException.cs