Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Configuration / System / Configuration / IntegerValidatorAttribute.cs / 1 / 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
- ComponentCommands.cs
- TargetFrameworkUtil.cs
- VirtualPathUtility.cs
- ProviderConnectionPoint.cs
- UnionCodeGroup.cs
- AffineTransform3D.cs
- XmlSchemaSimpleContentRestriction.cs
- Simplifier.cs
- UpnEndpointIdentity.cs
- TrackingDataItemValue.cs
- AccessibilityHelperForXpWin2k3.cs
- DictionaryEntry.cs
- XpsSerializationManagerAsync.cs
- FileNotFoundException.cs
- XamlParser.cs
- RequestTimeoutManager.cs
- EntityDataSourceState.cs
- TextServicesManager.cs
- RequestDescription.cs
- Point3DAnimationBase.cs
- AmbiguousMatchException.cs
- SourceFilter.cs
- ImportedNamespaceContextItem.cs
- DataView.cs
- BinaryExpression.cs
- HtmlSelect.cs
- SafeNativeMethods.cs
- _FtpControlStream.cs
- UrlPropertyAttribute.cs
- RadioButtonPopupAdapter.cs
- XmlAttributeProperties.cs
- BlurEffect.cs
- SingletonInstanceContextProvider.cs
- ImageFormat.cs
- ObservableDictionary.cs
- ScrollBar.cs
- TraceHandlerErrorFormatter.cs
- NotCondition.cs
- HierarchicalDataSourceControl.cs
- ObjectContext.cs
- ControlCollection.cs
- GeometryConverter.cs
- Documentation.cs
- MetadataArtifactLoaderFile.cs
- HMACSHA256.cs
- DesignerSerializerAttribute.cs
- Label.cs
- RelationalExpressions.cs
- ExtensionWindow.cs
- Label.cs
- MutexSecurity.cs
- CompiledRegexRunner.cs
- InputBinding.cs
- TypeNameConverter.cs
- IndentTextWriter.cs
- DataGridViewComboBoxCell.cs
- MonitoringDescriptionAttribute.cs
- StringDictionary.cs
- NativeObjectSecurity.cs
- DesignerActionService.cs
- Debug.cs
- GridViewAutoFormat.cs
- EventHandlersStore.cs
- TableLayoutStyle.cs
- XamlTypeWithExplicitNamespace.cs
- httpapplicationstate.cs
- PointHitTestResult.cs
- TemplateComponentConnector.cs
- IfJoinedCondition.cs
- DataGridViewRowHeaderCell.cs
- Quaternion.cs
- EntityProviderServices.cs
- Rect3DConverter.cs
- CardSpaceSelector.cs
- MessageContractExporter.cs
- OdbcConnectionFactory.cs
- ConstraintStruct.cs
- RuntimeCompatibilityAttribute.cs
- ResourceProviderFactory.cs
- GlobalAllocSafeHandle.cs
- TagPrefixCollection.cs
- SQLMoneyStorage.cs
- TemplateBindingExpressionConverter.cs
- unsafenativemethodstextservices.cs
- Geometry.cs
- WindowManager.cs
- ViewLoader.cs
- CodeCastExpression.cs
- BinaryObjectReader.cs
- SymbolType.cs
- SelectionEditingBehavior.cs
- DesignOnlyAttribute.cs
- DetailsViewCommandEventArgs.cs
- RegexStringValidatorAttribute.cs
- ISAPIApplicationHost.cs
- XmlQueryType.cs
- PackUriHelper.cs
- UnsafeNativeMethods.cs
- ManifestResourceInfo.cs
- FtpRequestCacheValidator.cs