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
- TableColumnCollection.cs
- LinqTreeNodeEvaluator.cs
- Baml6Assembly.cs
- VariableBinder.cs
- BuiltInExpr.cs
- CqlLexerHelpers.cs
- DBCommandBuilder.cs
- ContainerControlDesigner.cs
- MenuScrollingVisibilityConverter.cs
- DateTimeConstantAttribute.cs
- MostlySingletonList.cs
- TreeWalkHelper.cs
- UserMapPath.cs
- ACL.cs
- XmlDigitalSignatureProcessor.cs
- DeflateStream.cs
- ConstNode.cs
- ListControlBoundActionList.cs
- XmlIlTypeHelper.cs
- BufferedStream.cs
- NeutralResourcesLanguageAttribute.cs
- DesignBindingValueUIHandler.cs
- CodeTypeDeclarationCollection.cs
- LowerCaseStringConverter.cs
- SchemaDeclBase.cs
- Matrix3DConverter.cs
- XmlSchema.cs
- UIElementPropertyUndoUnit.cs
- SocketException.cs
- CodeSubDirectory.cs
- IndentedWriter.cs
- ClipboardData.cs
- SendActivityEventArgs.cs
- MeasurementDCInfo.cs
- XamlPoint3DCollectionSerializer.cs
- CollectionCodeDomSerializer.cs
- XamlPoint3DCollectionSerializer.cs
- MatrixAnimationUsingKeyFrames.cs
- MdiWindowListItemConverter.cs
- GifBitmapEncoder.cs
- XmlNotation.cs
- ImageCodecInfo.cs
- DoubleCollection.cs
- LabelTarget.cs
- CustomAttributeBuilder.cs
- DependencyPropertyKind.cs
- propertyentry.cs
- HttpListener.cs
- ListViewInsertionMark.cs
- PolicyStatement.cs
- ListViewSelectEventArgs.cs
- ColumnClickEvent.cs
- ToolStripDropTargetManager.cs
- PolyBezierSegment.cs
- HtmlInputImage.cs
- DBDataPermissionAttribute.cs
- Parser.cs
- TransactionScopeDesigner.cs
- UserPreferenceChangedEventArgs.cs
- RequestContext.cs
- EntryIndex.cs
- WebPartHelpVerb.cs
- FloaterBaseParagraph.cs
- UrlMappingsSection.cs
- TemplatedWizardStep.cs
- DependencyPropertyConverter.cs
- MouseBinding.cs
- HttpDigestClientCredential.cs
- DiscreteKeyFrames.cs
- ImportCatalogPart.cs
- NamespaceList.cs
- TypeResolver.cs
- MachineKeyConverter.cs
- WebConfigurationManager.cs
- SeverityFilter.cs
- StaticSiteMapProvider.cs
- LineInfo.cs
- BufferModeSettings.cs
- GuidelineCollection.cs
- FixedBufferAttribute.cs
- HttpHandlersSection.cs
- ASCIIEncoding.cs
- DataGridTableCollection.cs
- ContentPosition.cs
- WmpBitmapEncoder.cs
- BufferCache.cs
- DataColumnSelectionConverter.cs
- LineInfo.cs
- DataGridViewAdvancedBorderStyle.cs
- DockAndAnchorLayout.cs
- PrintPreviewDialog.cs
- SmiEventSink.cs
- OdbcParameter.cs
- IndicCharClassifier.cs
- TypeSystem.cs
- NotifyCollectionChangedEventArgs.cs
- XmlWriterSettings.cs
- CustomError.cs
- SqlWriter.cs
- KeyedCollection.cs