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
- SingleAnimationUsingKeyFrames.cs
- OneOfConst.cs
- TypeReference.cs
- WebPartExportVerb.cs
- UIElement.cs
- TransformationRules.cs
- TextWriter.cs
- StreamGeometry.cs
- DbParameterCollectionHelper.cs
- DataGridRowEventArgs.cs
- ColorAnimationBase.cs
- StrokeRenderer.cs
- DataObjectPastingEventArgs.cs
- X509RecipientCertificateClientElement.cs
- TextBoxBase.cs
- HostProtectionPermission.cs
- HtmlInputControl.cs
- SimpleFileLog.cs
- SQLDateTime.cs
- TogglePatternIdentifiers.cs
- UriExt.cs
- UnionExpr.cs
- SqlClientMetaDataCollectionNames.cs
- StatusBarAutomationPeer.cs
- WriteFileContext.cs
- Clipboard.cs
- AliasGenerator.cs
- SelectionBorderGlyph.cs
- ItemCheckEvent.cs
- DesignTable.cs
- LogicalTreeHelper.cs
- Point3D.cs
- URLIdentityPermission.cs
- CfgRule.cs
- Switch.cs
- MouseGesture.cs
- ErrorProvider.cs
- DataControlField.cs
- AccessControlList.cs
- SafeProcessHandle.cs
- VisualStates.cs
- DBConnection.cs
- DigestComparer.cs
- Renderer.cs
- InputGestureCollection.cs
- ScrollPatternIdentifiers.cs
- TextFormatterHost.cs
- EventLogTraceListener.cs
- CodeEntryPointMethod.cs
- Int32Rect.cs
- DataObjectMethodAttribute.cs
- EnumerableCollectionView.cs
- FileUpload.cs
- StrongNameUtility.cs
- TypeBuilder.cs
- TextPointerBase.cs
- MethodAccessException.cs
- ProcessModule.cs
- SHA256Cng.cs
- Subset.cs
- QueryStoreStatusRequest.cs
- OdbcConnectionStringbuilder.cs
- QueryConverter.cs
- NaturalLanguageHyphenator.cs
- ConstraintManager.cs
- SocketElement.cs
- WorkflowServiceBehavior.cs
- ButtonPopupAdapter.cs
- XsdBuildProvider.cs
- MetadataResolver.cs
- PartitionerQueryOperator.cs
- TextPointerBase.cs
- StyleSheetDesigner.cs
- AffineTransform3D.cs
- Application.cs
- PenThreadPool.cs
- SequentialUshortCollection.cs
- RequestCachePolicyConverter.cs
- ListViewCommandEventArgs.cs
- RegisteredHiddenField.cs
- DrawingAttributesDefaultValueFactory.cs
- DataViewManager.cs
- AnnouncementEndpointElement.cs
- VideoDrawing.cs
- SessionStateModule.cs
- ServiceBuildProvider.cs
- InteropBitmapSource.cs
- SessionStateUtil.cs
- KeyGestureValueSerializer.cs
- Mapping.cs
- smtpconnection.cs
- ListSourceHelper.cs
- MasterPageCodeDomTreeGenerator.cs
- HttpResponseHeader.cs
- FrameworkContextData.cs
- UrlPath.cs
- WebSysDisplayNameAttribute.cs
- Queue.cs
- TypeRefElement.cs
- Line.cs