Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- AnonymousIdentificationSection.cs
- UserValidatedEventArgs.cs
- _CacheStreams.cs
- DataGridViewCellLinkedList.cs
- CommandLibraryHelper.cs
- UpdateExpressionVisitor.cs
- ProfessionalColorTable.cs
- CodeMemberMethod.cs
- ProgressBarAutomationPeer.cs
- DbProviderFactoriesConfigurationHandler.cs
- EllipticalNodeOperations.cs
- XmlValueConverter.cs
- OpCellTreeNode.cs
- Int64Storage.cs
- Matrix3D.cs
- AssemblyBuilderData.cs
- RIPEMD160.cs
- Block.cs
- log.cs
- ArgIterator.cs
- ClientConfigurationHost.cs
- CommonProperties.cs
- SapiRecoInterop.cs
- DateTimeConstantAttribute.cs
- ToolStripLabel.cs
- ImportCatalogPart.cs
- baseaxisquery.cs
- MultiSelectRootGridEntry.cs
- FolderBrowserDialog.cs
- BuildManager.cs
- WebConfigurationFileMap.cs
- LOSFormatter.cs
- XmlSchemaException.cs
- ImageInfo.cs
- LiteralControl.cs
- OleDbStruct.cs
- XmlChoiceIdentifierAttribute.cs
- _LocalDataStoreMgr.cs
- PixelShader.cs
- StackBuilderSink.cs
- MexBindingElement.cs
- Speller.cs
- OdbcConnectionFactory.cs
- TextClipboardData.cs
- Typography.cs
- SqlBooleanMismatchVisitor.cs
- OdbcHandle.cs
- RtfFormatStack.cs
- AnnouncementEventArgs.cs
- ClaimComparer.cs
- Vector3D.cs
- UserControlBuildProvider.cs
- LastQueryOperator.cs
- Attributes.cs
- ResourceDescriptionAttribute.cs
- ISFTagAndGuidCache.cs
- QilPatternVisitor.cs
- QueryIntervalOp.cs
- PersonalizableAttribute.cs
- CmsInterop.cs
- PageCopyCount.cs
- FtpCachePolicyElement.cs
- DataGridSortCommandEventArgs.cs
- SoapSchemaMember.cs
- CompiledQuery.cs
- MsmqInputChannelBase.cs
- Visual3D.cs
- RemoteWebConfigurationHostStream.cs
- SmtpAuthenticationManager.cs
- DataGridViewCellValueEventArgs.cs
- SafeFindHandle.cs
- SkewTransform.cs
- TcpConnectionPool.cs
- SelectionChangedEventArgs.cs
- CachedResourceDictionaryExtension.cs
- SspiNegotiationTokenAuthenticatorState.cs
- ActivityTypeResolver.xaml.cs
- MonthChangedEventArgs.cs
- InvalidChannelBindingException.cs
- Random.cs
- CollectionViewGroupRoot.cs
- DbConnectionHelper.cs
- RsaSecurityToken.cs
- RemotingConfigParser.cs
- WebPartEditorApplyVerb.cs
- TextBox.cs
- CodeFieldReferenceExpression.cs
- FrameworkElementFactory.cs
- ReadWriteSpinLock.cs
- DoubleLinkList.cs
- IMembershipProvider.cs
- PasswordRecoveryAutoFormat.cs
- WSTrustDec2005.cs
- invalidudtexception.cs
- ImageInfo.cs
- ToolStripDropDownItem.cs
- MetadataItemSerializer.cs
- DataColumn.cs
- DataServiceRequest.cs
- GeneralTransform3D.cs