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
- SEHException.cs
- NativeMethods.cs
- Schedule.cs
- LocationUpdates.cs
- XsdBuilder.cs
- XmlNodeChangedEventArgs.cs
- ContentPlaceHolder.cs
- X509Utils.cs
- EUCJPEncoding.cs
- MeasureItemEvent.cs
- DataGridViewRowConverter.cs
- Stream.cs
- SaveWorkflowAsyncResult.cs
- BitmapScalingModeValidation.cs
- QilNode.cs
- TextTreeFixupNode.cs
- SetStoryboardSpeedRatio.cs
- TagMapInfo.cs
- DesignerVerbCollection.cs
- TraceListener.cs
- StringToken.cs
- SapiRecoContext.cs
- ResourceProperty.cs
- CachedPathData.cs
- BinaryParser.cs
- DetailsViewPageEventArgs.cs
- DataServiceProviderMethods.cs
- Stack.cs
- WebSysDefaultValueAttribute.cs
- WindowsSlider.cs
- DeflateStreamAsyncResult.cs
- IndicCharClassifier.cs
- AdCreatedEventArgs.cs
- Model3D.cs
- XmlSignatureProperties.cs
- ChannelSinkStacks.cs
- CaseInsensitiveHashCodeProvider.cs
- HtmlElementErrorEventArgs.cs
- CursorConverter.cs
- Mouse.cs
- GZipStream.cs
- ChannelReliableSession.cs
- ObjectDataSourceWizardForm.cs
- ListViewInsertedEventArgs.cs
- ObjectDataSourceDisposingEventArgs.cs
- CompressEmulationStream.cs
- wmiprovider.cs
- HttpPostedFileBase.cs
- GiveFeedbackEvent.cs
- CustomMenuItemCollection.cs
- CacheForPrimitiveTypes.cs
- TableRow.cs
- TargetConverter.cs
- SoapTransportImporter.cs
- TextStore.cs
- HtmlShim.cs
- CachedBitmap.cs
- MergeFailedEvent.cs
- XmlAttribute.cs
- WebConfigurationFileMap.cs
- WorkerRequest.cs
- Native.cs
- EncryptedType.cs
- InvalidComObjectException.cs
- QueryStoreStatusRequest.cs
- EventMappingSettings.cs
- ConstraintConverter.cs
- FlowDocumentReader.cs
- SqlDataReader.cs
- DesignerLabelAdapter.cs
- ImpersonationContext.cs
- CodeDomDesignerLoader.cs
- HttpTransportElement.cs
- SynchronizationHandlesCodeDomSerializer.cs
- ClientBuildManagerCallback.cs
- figurelengthconverter.cs
- ButtonRenderer.cs
- SqlUtil.cs
- DiscardableAttribute.cs
- AudioException.cs
- SymbolPair.cs
- SqlException.cs
- ProcessStartInfo.cs
- AsyncOperationContext.cs
- FigureParagraph.cs
- Module.cs
- ObjectKeyFrameCollection.cs
- NotConverter.cs
- ServiceOperationParameter.cs
- ToolboxItemWrapper.cs
- BlockUIContainer.cs
- GeometryGroup.cs
- WizardPanel.cs
- Operator.cs
- _OSSOCK.cs
- EventMemberCodeDomSerializer.cs
- ValidateNames.cs
- RedirectionProxy.cs
- QilLiteral.cs
- XmlObjectSerializerContext.cs