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
- LabelDesigner.cs
- DataProtection.cs
- Timer.cs
- FocusManager.cs
- MediaElement.cs
- TextParagraphCache.cs
- SystemTcpStatistics.cs
- CounterCreationData.cs
- TextRunProperties.cs
- PermissionListSet.cs
- DecimalAnimationBase.cs
- MetadataProperty.cs
- HttpCapabilitiesSectionHandler.cs
- Console.cs
- CallTemplateAction.cs
- SafeNativeMethods.cs
- CompositeScriptReferenceEventArgs.cs
- ObjectQueryExecutionPlan.cs
- ActiveXSite.cs
- _DigestClient.cs
- HuffModule.cs
- SimpleHandlerFactory.cs
- AuthenticatedStream.cs
- ListViewUpdateEventArgs.cs
- BitmapEffectCollection.cs
- RegexMatch.cs
- Directory.cs
- ADRoleFactory.cs
- FieldToken.cs
- ModelPerspective.cs
- SpoolingTaskBase.cs
- FilteredAttributeCollection.cs
- RuleSettings.cs
- RangeContentEnumerator.cs
- TextEditorCopyPaste.cs
- ClassImporter.cs
- CodeTypeParameterCollection.cs
- ConsoleKeyInfo.cs
- Int64Storage.cs
- CommandManager.cs
- NodeLabelEditEvent.cs
- ImplicitInputBrush.cs
- TreeViewItem.cs
- ExternalCalls.cs
- Vector.cs
- PerformanceCounterManager.cs
- ColumnMapProcessor.cs
- CodeNamespaceCollection.cs
- FontWeights.cs
- InternalTransaction.cs
- InvalidCastException.cs
- GridViewRowEventArgs.cs
- ProfileEventArgs.cs
- SkipStoryboardToFill.cs
- XmlConvert.cs
- SQLBinaryStorage.cs
- SqlUtil.cs
- SmtpTransport.cs
- HostingEnvironmentSection.cs
- NamespaceInfo.cs
- COM2ExtendedUITypeEditor.cs
- Point3DCollection.cs
- storepermissionattribute.cs
- Help.cs
- ClientSession.cs
- Scene3D.cs
- ChoiceConverter.cs
- RSAProtectedConfigurationProvider.cs
- SqlUserDefinedTypeAttribute.cs
- Tokenizer.cs
- HandlerBase.cs
- ServiceDescriptionReflector.cs
- Timer.cs
- TemplateBindingExpression.cs
- IgnorePropertiesAttribute.cs
- HTMLTagNameToTypeMapper.cs
- PathSegment.cs
- SystemColors.cs
- WebPartEditorCancelVerb.cs
- ProxyElement.cs
- XmlSchemaFacet.cs
- EmptyEnumerator.cs
- BinaryFormatterWriter.cs
- KeyNotFoundException.cs
- Compiler.cs
- securestring.cs
- WebPageTraceListener.cs
- NumericUpDownAcceleration.cs
- ContractMapping.cs
- ContextMenu.cs
- XmlSerializationReader.cs
- PriorityRange.cs
- Brushes.cs
- CfgRule.cs
- CachedTypeface.cs
- RectangleConverter.cs
- XamlInterfaces.cs
- InternalConfigHost.cs
- WindowsButton.cs
- Effect.cs