Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- RadialGradientBrush.cs
- TreeNodeBindingCollection.cs
- SchemaImporter.cs
- RIPEMD160.cs
- CommandHelpers.cs
- Control.cs
- UnsafeNativeMethods.cs
- DesignerActionTextItem.cs
- Color.cs
- QilIterator.cs
- HttpDebugHandler.cs
- ColumnReorderedEventArgs.cs
- GridViewCommandEventArgs.cs
- AssociationTypeEmitter.cs
- PublisherMembershipCondition.cs
- SkewTransform.cs
- DataErrorValidationRule.cs
- userdatakeys.cs
- DecimalStorage.cs
- ProcessRequestArgs.cs
- Win32SafeHandles.cs
- NotificationContext.cs
- MouseCaptureWithinProperty.cs
- ToolStripComboBox.cs
- WebPartDisplayModeEventArgs.cs
- MenuCommandsChangedEventArgs.cs
- LineSegment.cs
- RealizationContext.cs
- DataGridHeaderBorder.cs
- ConfigurationElementCollection.cs
- ObjectQueryState.cs
- InternalControlCollection.cs
- WindowsPen.cs
- PolicyDesigner.cs
- VirtualDirectoryMapping.cs
- DataGridViewCellCollection.cs
- ArgumentOutOfRangeException.cs
- SchemaImporter.cs
- FileDetails.cs
- Exception.cs
- PingOptions.cs
- QilTernary.cs
- NamespaceList.cs
- TableHeaderCell.cs
- ConnectionStringSettingsCollection.cs
- HtmlUtf8RawTextWriter.cs
- NumericUpDownAccelerationCollection.cs
- WindowsNonControl.cs
- ListControlConvertEventArgs.cs
- ManagementNamedValueCollection.cs
- StdValidatorsAndConverters.cs
- ProtectedConfiguration.cs
- DoWorkEventArgs.cs
- RegionIterator.cs
- AudioStateChangedEventArgs.cs
- TextRangeAdaptor.cs
- DbTransaction.cs
- StructuredTypeEmitter.cs
- InvalidOleVariantTypeException.cs
- OleDbCommand.cs
- PassportAuthentication.cs
- MergeFailedEvent.cs
- PathData.cs
- CheckPair.cs
- EntityViewGenerationConstants.cs
- LocalValueEnumerator.cs
- ExpressionHelper.cs
- StyleTypedPropertyAttribute.cs
- CqlLexerHelpers.cs
- EntityContainerAssociationSet.cs
- MarshalDirectiveException.cs
- RectAnimationClockResource.cs
- FilterableData.cs
- VisualBrush.cs
- RSAPKCS1SignatureFormatter.cs
- UIElementParaClient.cs
- Int16.cs
- MetadataPropertyvalue.cs
- WebBaseEventKeyComparer.cs
- XmlDocumentFragment.cs
- StructuralComparisons.cs
- ListParagraph.cs
- PathSegment.cs
- SystemBrushes.cs
- Dictionary.cs
- WindowsListViewGroup.cs
- StyleSheetComponentEditor.cs
- GenericPrincipal.cs
- ToolStripContainer.cs
- HMAC.cs
- IdentityModelStringsVersion1.cs
- ConfigXmlReader.cs
- BamlMapTable.cs
- EvidenceBase.cs
- OdbcInfoMessageEvent.cs
- CompositeCollectionView.cs
- GroupItem.cs
- PrimitiveXmlSerializers.cs
- TypeDelegator.cs
- QueuePropertyVariants.cs