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
- CreateRefExpr.cs
- PathSegmentCollection.cs
- SingleTagSectionHandler.cs
- invalidudtexception.cs
- TextRange.cs
- RegexMatchCollection.cs
- ListViewSelectEventArgs.cs
- GridViewRowPresenter.cs
- Rect.cs
- XmlIgnoreAttribute.cs
- WebBrowsableAttribute.cs
- MulticastOption.cs
- BaseTemplateParser.cs
- EntityDataSourceConfigureObjectContextPanel.cs
- UnmanagedBitmapWrapper.cs
- XmlSchemaSubstitutionGroup.cs
- StateWorkerRequest.cs
- EncodingTable.cs
- AddInStore.cs
- ValidationPropertyAttribute.cs
- WebPartTracker.cs
- IndexOutOfRangeException.cs
- DetailsViewPagerRow.cs
- MouseActionValueSerializer.cs
- ClosableStream.cs
- OleDbDataAdapter.cs
- CodeObject.cs
- CollectionContainer.cs
- DefaultTraceListener.cs
- FieldNameLookup.cs
- EncodingFallbackAwareXmlTextWriter.cs
- InkCanvasAutomationPeer.cs
- DelegateBodyWriter.cs
- XPathExpr.cs
- XmlArrayItemAttribute.cs
- MetadataWorkspace.cs
- PenThreadPool.cs
- TagMapCollection.cs
- XmlEventCache.cs
- CodeSpit.cs
- SmiRecordBuffer.cs
- WebControlAdapter.cs
- XmlSchemaSimpleTypeUnion.cs
- PrivilegedConfigurationManager.cs
- FastPropertyAccessor.cs
- PropertyChangedEventArgs.cs
- FilterEventArgs.cs
- MenuBase.cs
- DataGridViewElement.cs
- ZipIOLocalFileHeader.cs
- EdgeProfileValidation.cs
- DetailsViewPageEventArgs.cs
- AlternateViewCollection.cs
- MultiViewDesigner.cs
- PointCollectionConverter.cs
- IgnorePropertiesAttribute.cs
- EntitySetRetriever.cs
- HttpApplicationFactory.cs
- ProcessThread.cs
- GiveFeedbackEvent.cs
- XmlObjectSerializerContext.cs
- SQLByte.cs
- COM2PictureConverter.cs
- BitmapVisualManager.cs
- Win32.cs
- WebPartDisplayMode.cs
- VisualBrush.cs
- BaseAsyncResult.cs
- XpsSerializerFactory.cs
- InternalBufferOverflowException.cs
- HtmlInputCheckBox.cs
- ScrollContentPresenter.cs
- LongAverageAggregationOperator.cs
- RuntimeCompatibilityAttribute.cs
- InstancePersistenceContext.cs
- AsyncOperationManager.cs
- WebPartCatalogCloseVerb.cs
- MultiPageTextView.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- ActivityBuilderHelper.cs
- DataGridViewTextBoxEditingControl.cs
- DataView.cs
- SelectionWordBreaker.cs
- WindowsRichEdit.cs
- DataGridParentRows.cs
- BigInt.cs
- DesignerLoader.cs
- ProjectionPathBuilder.cs
- WindowsToolbarItemAsMenuItem.cs
- RowTypePropertyElement.cs
- TextRangeEditTables.cs
- SmiContextFactory.cs
- VirtualDirectoryMappingCollection.cs
- XmlWriterTraceListener.cs
- OleDbException.cs
- GridViewDeletedEventArgs.cs
- DbConnectionClosed.cs
- MatrixAnimationBase.cs
- PeerReferralPolicy.cs
- xmlfixedPageInfo.cs