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
- LogWriteRestartAreaAsyncResult.cs
- DataGridItem.cs
- XmlQueryStaticData.cs
- KeysConverter.cs
- BuildProviderUtils.cs
- MultiPartWriter.cs
- ListBindableAttribute.cs
- ValueHandle.cs
- ControlPropertyNameConverter.cs
- RouteItem.cs
- StateMachineSubscription.cs
- StrongNameUtility.cs
- Stream.cs
- SqlServices.cs
- TextBox.cs
- VisualBasicDesignerHelper.cs
- HeaderedItemsControl.cs
- OutputCacheProfile.cs
- StructuredProperty.cs
- HtmlInputText.cs
- BitmapEffectDrawingContent.cs
- SamlEvidence.cs
- ThreadInterruptedException.cs
- RootBuilder.cs
- UInt64.cs
- PrintController.cs
- AmbientLight.cs
- webbrowsersite.cs
- CompiledQuery.cs
- PropertyBuilder.cs
- Int32RectConverter.cs
- BaseAppDomainProtocolHandler.cs
- SQLInt32.cs
- KeyMatchBuilder.cs
- XPathNavigator.cs
- ListDictionary.cs
- ZeroOpNode.cs
- DataTableMapping.cs
- ResourceDisplayNameAttribute.cs
- Pts.cs
- CapabilitiesUse.cs
- EventLogger.cs
- TextLineBreak.cs
- _SslSessionsCache.cs
- SQLBinaryStorage.cs
- Soap.cs
- OracleParameterBinding.cs
- SQLInt32.cs
- AvTrace.cs
- BCryptSafeHandles.cs
- CharAnimationUsingKeyFrames.cs
- TimeStampChecker.cs
- Token.cs
- AssemblySettingAttributes.cs
- SqlInfoMessageEvent.cs
- TextSyndicationContentKindHelper.cs
- TypeElementCollection.cs
- BreakRecordTable.cs
- CapacityStreamGeometryContext.cs
- UnsafeNativeMethods.cs
- BamlRecordHelper.cs
- WebConfigurationHostFileChange.cs
- VisualBrush.cs
- EntityClientCacheEntry.cs
- ListViewItemEventArgs.cs
- DigestTraceRecordHelper.cs
- TlsnegoTokenProvider.cs
- TimeSpanValidator.cs
- Command.cs
- Preprocessor.cs
- HandleCollector.cs
- FormViewActionList.cs
- WarningException.cs
- SQLInt16.cs
- SchemaElementDecl.cs
- CompatibleComparer.cs
- WindowsIPAddress.cs
- Timer.cs
- Mapping.cs
- NullToBooleanConverter.cs
- XmlSchemaComplexContent.cs
- Tuple.cs
- PolicyAssertionCollection.cs
- AddInServer.cs
- DataRow.cs
- MinMaxParagraphWidth.cs
- SmtpCommands.cs
- X509Certificate.cs
- IListConverters.cs
- XmlNamespaceDeclarationsAttribute.cs
- CachedFontFamily.cs
- TrackBar.cs
- _Rfc2616CacheValidators.cs
- Block.cs
- NotificationContext.cs
- VerticalAlignConverter.cs
- WindowsListView.cs
- Faults.cs
- CodeStatement.cs
- InternalConfigConfigurationFactory.cs