Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / IntegerValidatorAttribute.cs / 1305376 / IntegerValidatorAttribute.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 IntegerValidatorAttribute : ConfigurationValidatorAttribute { private int _min = int.MinValue; private int _max = int.MaxValue; private bool _excludeRange = false; public IntegerValidatorAttribute() { } public override ConfigurationValidatorBase ValidatorInstance { get { return new IntegerValidator(_min, _max, _excludeRange); } } public int MinValue { get { return _min; } set { if (_max < value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _min = value; } } public int MaxValue { get { return _max; } set { if (_min > value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _max = value; } } public bool ExcludeRange { get { return _excludeRange; } set { _excludeRange = 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 IntegerValidatorAttribute : ConfigurationValidatorAttribute { private int _min = int.MinValue; private int _max = int.MaxValue; private bool _excludeRange = false; public IntegerValidatorAttribute() { } public override ConfigurationValidatorBase ValidatorInstance { get { return new IntegerValidator(_min, _max, _excludeRange); } } public int MinValue { get { return _min; } set { if (_max < value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _min = value; } } public int MaxValue { get { return _max; } set { if (_min > value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _max = value; } } public bool ExcludeRange { get { return _excludeRange; } set { _excludeRange = 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
- VisualStyleInformation.cs
- XPathSelectionIterator.cs
- shaperfactoryquerycacheentry.cs
- Nullable.cs
- dsa.cs
- MutableAssemblyCacheEntry.cs
- MsmqIntegrationProcessProtocolHandler.cs
- DecimalConverter.cs
- AccessDataSourceView.cs
- NamespaceMapping.cs
- ISAPIWorkerRequest.cs
- DiagnosticTrace.cs
- HttpResponseInternalBase.cs
- RewritingSimplifier.cs
- ClrProviderManifest.cs
- TablePattern.cs
- SqlMethodCallConverter.cs
- DependentList.cs
- MultiSelector.cs
- MobileListItem.cs
- CatalogZone.cs
- XmlRawWriter.cs
- TrustLevelCollection.cs
- PageBreakRecord.cs
- ControlAdapter.cs
- BitmapEncoder.cs
- SubpageParagraph.cs
- ConnectionInterfaceCollection.cs
- StrokeCollectionConverter.cs
- LinkClickEvent.cs
- WebControlParameterProxy.cs
- StateDesignerConnector.cs
- CheckedPointers.cs
- TextDpi.cs
- VectorAnimationBase.cs
- InstanceData.cs
- ProfileManager.cs
- EditingCommands.cs
- SystemIcmpV6Statistics.cs
- DockAndAnchorLayout.cs
- ReflectPropertyDescriptor.cs
- mediaeventshelper.cs
- BulletChrome.cs
- DocumentSchemaValidator.cs
- StopStoryboard.cs
- ByteFacetDescriptionElement.cs
- PathSegment.cs
- CodeCompileUnit.cs
- HttpConfigurationSystem.cs
- Vector3DValueSerializer.cs
- ListSourceHelper.cs
- UpdateCommand.cs
- ResourceAttributes.cs
- WindowsProgressbar.cs
- MediaSystem.cs
- WindowsListViewItemStartMenu.cs
- CheckBoxField.cs
- OutputCacheProfileCollection.cs
- ComponentFactoryHelpers.cs
- TdsParserStateObject.cs
- XsltArgumentList.cs
- DesignerActionHeaderItem.cs
- ConversionHelper.cs
- ScrollBarRenderer.cs
- HtmlContainerControl.cs
- SafeEventLogWriteHandle.cs
- ChangeInterceptorAttribute.cs
- LayoutManager.cs
- ScrollContentPresenter.cs
- ValuePattern.cs
- AudioSignalProblemOccurredEventArgs.cs
- RangeExpression.cs
- SymbolTable.cs
- ProfilePropertyNameValidator.cs
- OracleDataReader.cs
- NetSectionGroup.cs
- NetworkStream.cs
- AddressAccessDeniedException.cs
- SatelliteContractVersionAttribute.cs
- AuthorizationRule.cs
- PeerPresenceInfo.cs
- InputProcessorProfiles.cs
- MatrixStack.cs
- DateTimeSerializationSection.cs
- Axis.cs
- _Events.cs
- GetPageCompletedEventArgs.cs
- InstanceDataCollection.cs
- XamlToRtfWriter.cs
- FormatVersion.cs
- PropertyGridCommands.cs
- ActivationArguments.cs
- BypassElement.cs
- SiteMapNodeItem.cs
- CodeAttributeArgumentCollection.cs
- AttachmentCollection.cs
- ThreadExceptionDialog.cs
- TcpClientSocketManager.cs
- CreationContext.cs
- TabRenderer.cs