Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SystemIPv4InterfaceProperties.cs
- TextTreeObjectNode.cs
- OutputBuffer.cs
- TreeWalkHelper.cs
- JavascriptXmlWriterWrapper.cs
- TreeNodeCollection.cs
- HasCopySemanticsAttribute.cs
- GenericTypeParameterBuilder.cs
- FormatConvertedBitmap.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- StyleSelector.cs
- Range.cs
- NoPersistScope.cs
- ProcessModuleDesigner.cs
- SimpleBitVector32.cs
- ScriptComponentDescriptor.cs
- ActivityDesigner.cs
- Attributes.cs
- BoolLiteral.cs
- ProcessManager.cs
- WindowInteractionStateTracker.cs
- CngProperty.cs
- KeyFrames.cs
- TreeNodeMouseHoverEvent.cs
- EventLogHandle.cs
- InputLanguageCollection.cs
- MeasurementDCInfo.cs
- brushes.cs
- SafeCryptContextHandle.cs
- LinkClickEvent.cs
- SecurityDescriptor.cs
- QuaternionAnimation.cs
- TraceHandler.cs
- WeakHashtable.cs
- XamlSerializerUtil.cs
- QilStrConcatenator.cs
- namescope.cs
- HeaderElement.cs
- HttpApplication.cs
- StorageRoot.cs
- OracleTransaction.cs
- FilterException.cs
- BindingOperations.cs
- XsdDataContractExporter.cs
- AnnotationDocumentPaginator.cs
- ValidationHelper.cs
- OptimizedTemplateContent.cs
- ClockGroup.cs
- BypassElementCollection.cs
- InheritanceRules.cs
- XPathScanner.cs
- Operand.cs
- Message.cs
- EntityConnectionStringBuilder.cs
- SqlFunctionAttribute.cs
- StorageTypeMapping.cs
- MulticastNotSupportedException.cs
- SafeHandle.cs
- SoapHeaderAttribute.cs
- TextModifierScope.cs
- MediaSystem.cs
- WorkflowApplicationCompletedException.cs
- XmlElementAttributes.cs
- TrackBar.cs
- CursorConverter.cs
- CopyNamespacesAction.cs
- StructuredTypeEmitter.cs
- ReachObjectContext.cs
- XmlLinkedNode.cs
- SynchronizationHandlesCodeDomSerializer.cs
- _Connection.cs
- RegisteredScript.cs
- PersonalizationEntry.cs
- GrammarBuilderRuleRef.cs
- CompensableActivity.cs
- CacheAxisQuery.cs
- DynamicQueryableWrapper.cs
- TdsParserStaticMethods.cs
- FlowDocumentView.cs
- OracleDataReader.cs
- DataGridViewCellMouseEventArgs.cs
- DataGridViewCellConverter.cs
- URLMembershipCondition.cs
- HttpRuntime.cs
- VirtualPathProvider.cs
- JapaneseLunisolarCalendar.cs
- WebServiceFaultDesigner.cs
- PathFigureCollectionValueSerializer.cs
- StrongNameUtility.cs
- SelectionGlyphBase.cs
- InheritablePropertyChangeInfo.cs
- RadialGradientBrush.cs
- MsmqIntegrationSecurity.cs
- GridViewUpdatedEventArgs.cs
- TemplateControlCodeDomTreeGenerator.cs
- XamlDesignerSerializationManager.cs
- SqlNamer.cs
- NetworkInformationException.cs
- PkcsMisc.cs
- ObjectTag.cs