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
- BrushValueSerializer.cs
- TagNameToTypeMapper.cs
- PropertyGridEditorPart.cs
- CodeDelegateInvokeExpression.cs
- TriggerCollection.cs
- MappingSource.cs
- ContentElement.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- DynamicObject.cs
- DependentList.cs
- TreeViewHitTestInfo.cs
- HuffModule.cs
- SQLUtility.cs
- OdbcUtils.cs
- WebServiceFaultDesigner.cs
- SamlAttributeStatement.cs
- DataServiceException.cs
- IssuanceLicense.cs
- documentation.cs
- GridViewColumnCollectionChangedEventArgs.cs
- Misc.cs
- NamedPermissionSet.cs
- SchemaNotation.cs
- MediaScriptCommandRoutedEventArgs.cs
- HttpContextBase.cs
- PieceNameHelper.cs
- TableCell.cs
- HostProtectionException.cs
- SeekStoryboard.cs
- HtmlString.cs
- ErrorActivity.cs
- GridViewEditEventArgs.cs
- loginstatus.cs
- Internal.cs
- InitializerFacet.cs
- AttributeProviderAttribute.cs
- EntityKey.cs
- ClientScriptItemCollection.cs
- IndicCharClassifier.cs
- SkewTransform.cs
- EntityCollectionChangedParams.cs
- PermissionSetTriple.cs
- StateMachineWorkflowDesigner.cs
- SqlFunctions.cs
- MultiSelectRootGridEntry.cs
- GrammarBuilderDictation.cs
- SignatureToken.cs
- XPathNavigatorKeyComparer.cs
- AuthenticateEventArgs.cs
- XPathCompileException.cs
- HttpRequestCacheValidator.cs
- CompressedStack.cs
- AdvancedBindingPropertyDescriptor.cs
- XmlIterators.cs
- SqlSelectStatement.cs
- DesignerDataSchemaClass.cs
- RemoteEndpointMessageProperty.cs
- ComplexObject.cs
- ScrollChrome.cs
- FilterException.cs
- ResXDataNode.cs
- FocusWithinProperty.cs
- WebDisplayNameAttribute.cs
- MailDefinition.cs
- ProcessHostConfigUtils.cs
- CachedRequestParams.cs
- ProfileManager.cs
- Popup.cs
- MergeFailedEvent.cs
- webproxy.cs
- BitmapMetadata.cs
- ProjectionRewriter.cs
- ReadOnlyHierarchicalDataSource.cs
- EnumValAlphaComparer.cs
- DataSetMappper.cs
- SHA512Managed.cs
- TemplateControl.cs
- ObjectAssociationEndMapping.cs
- ObsoleteAttribute.cs
- ParameterModifier.cs
- BindingGraph.cs
- Transform3DGroup.cs
- IteratorFilter.cs
- EnvelopedPkcs7.cs
- InternalBufferManager.cs
- ToolStripAdornerWindowService.cs
- nulltextnavigator.cs
- TimeManager.cs
- ProtectedConfigurationSection.cs
- EDesignUtil.cs
- AQNBuilder.cs
- EventHandlersDesigner.cs
- XmlSerializerAssemblyAttribute.cs
- Section.cs
- ContainerUIElement3D.cs
- EventListenerClientSide.cs
- CodeArgumentReferenceExpression.cs
- ProjectionCamera.cs
- ListMarkerLine.cs
- ParagraphVisual.cs