Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / IntegerValidatorAttribute.cs / 1305376 / 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
- CodeTypeParameterCollection.cs
- CodeAttributeDeclaration.cs
- NavigationCommands.cs
- RayMeshGeometry3DHitTestResult.cs
- WebPart.cs
- SqlMethodAttribute.cs
- HTTPRemotingHandler.cs
- DataControlButton.cs
- Token.cs
- UInt16Converter.cs
- TypeConverter.cs
- UserUseLicenseDictionaryLoader.cs
- ProgressChangedEventArgs.cs
- HostedImpersonationContext.cs
- TextAutomationPeer.cs
- SerializationStore.cs
- TaskFileService.cs
- App.cs
- ProfilePropertySettings.cs
- TransactionManager.cs
- XslTransform.cs
- GroupItem.cs
- DataGridViewCellParsingEventArgs.cs
- SynchronizationLockException.cs
- ValueConversionAttribute.cs
- Bezier.cs
- DataServiceHost.cs
- TimeSpan.cs
- QilInvokeEarlyBound.cs
- UpdateTranslator.cs
- BulletDecorator.cs
- KeyValuePair.cs
- LocalBuilder.cs
- SecurityManager.cs
- UInt32.cs
- DataGridClipboardHelper.cs
- XmlCDATASection.cs
- DeriveBytes.cs
- XmlCodeExporter.cs
- BufferAllocator.cs
- TransformGroup.cs
- SliderAutomationPeer.cs
- GetPageNumberCompletedEventArgs.cs
- FormParameter.cs
- SuppressIldasmAttribute.cs
- EventManager.cs
- SHA1CryptoServiceProvider.cs
- SecurityHeader.cs
- WindowsGraphicsWrapper.cs
- LicFileLicenseProvider.cs
- SourceLineInfo.cs
- ToolStripItemTextRenderEventArgs.cs
- BinaryNode.cs
- FormsAuthenticationConfiguration.cs
- CSharpCodeProvider.cs
- CustomCategoryAttribute.cs
- ChangeConflicts.cs
- AlternateViewCollection.cs
- XmlElementAttribute.cs
- CodeAccessPermission.cs
- SHA256CryptoServiceProvider.cs
- securitymgrsite.cs
- ConnectionOrientedTransportElement.cs
- WebPartEditVerb.cs
- InputBinder.cs
- QueryExtender.cs
- HtmlElement.cs
- DataTableClearEvent.cs
- Tablet.cs
- WebZone.cs
- EncryptedType.cs
- ImmutableObjectAttribute.cs
- DeferredElementTreeState.cs
- SQLString.cs
- SEHException.cs
- ManagementPath.cs
- WaitHandle.cs
- Closure.cs
- ToolBarOverflowPanel.cs
- Selection.cs
- RunInstallerAttribute.cs
- GridViewItemAutomationPeer.cs
- AvTraceDetails.cs
- ToolbarAUtomationPeer.cs
- GlyphTypeface.cs
- Guid.cs
- _FixedSizeReader.cs
- SettingsProperty.cs
- SetterBase.cs
- BasicCommandTreeVisitor.cs
- SQLInt32Storage.cs
- BamlResourceSerializer.cs
- LinkButton.cs
- DocumentOrderQuery.cs
- ColorDialog.cs
- WindowsFormsSectionHandler.cs
- InputScope.cs
- KeysConverter.cs
- FieldAccessException.cs
- Utils.cs