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
- ComplusEndpointConfigContainer.cs
- DataSysAttribute.cs
- SectionXmlInfo.cs
- IsolatedStorageException.cs
- ObjectDisposedException.cs
- ConstNode.cs
- XmlDocumentFragment.cs
- MasterPageBuildProvider.cs
- ListSortDescription.cs
- XmlQueryCardinality.cs
- DragDrop.cs
- DataGridColumnCollection.cs
- ProtocolsConfigurationHandler.cs
- FlowDocument.cs
- StrokeIntersection.cs
- COM2TypeInfoProcessor.cs
- MonthCalendar.cs
- HeaderUtility.cs
- HtmlWindowCollection.cs
- X509RawDataKeyIdentifierClause.cs
- TimeSpanConverter.cs
- StylusCollection.cs
- LowerCaseStringConverter.cs
- SettingsPropertyWrongTypeException.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- HostedHttpContext.cs
- WebPartDescription.cs
- CommunicationObject.cs
- FixedNode.cs
- LinkTarget.cs
- RolePrincipal.cs
- Transform.cs
- UIntPtr.cs
- ObfuscateAssemblyAttribute.cs
- SafeBitVector32.cs
- Int64AnimationBase.cs
- SByteStorage.cs
- serverconfig.cs
- TokenBasedSet.cs
- MergeExecutor.cs
- DBSqlParserTableCollection.cs
- PasswordBox.cs
- DataGridViewRowPrePaintEventArgs.cs
- ToolStripRenderer.cs
- ControlSerializer.cs
- ExtendedTransformFactory.cs
- Variant.cs
- FilterableAttribute.cs
- WebPartActionVerb.cs
- CodeValidator.cs
- Debug.cs
- XmlNamespaceDeclarationsAttribute.cs
- ObjectPersistData.cs
- DbProviderConfigurationHandler.cs
- TransactionManager.cs
- Tuple.cs
- Attachment.cs
- DbConnectionClosed.cs
- ElementHost.cs
- WebEventTraceProvider.cs
- AttributeSetAction.cs
- _SSPIWrapper.cs
- PrintPreviewGraphics.cs
- RelOps.cs
- TemplateInstanceAttribute.cs
- RegexTree.cs
- BulletedListEventArgs.cs
- ActivityWithResultWrapper.cs
- PageContentCollection.cs
- DetailsViewModeEventArgs.cs
- ContextItemManager.cs
- RijndaelManaged.cs
- CodeConstructor.cs
- MatrixCamera.cs
- XmlDictionary.cs
- ExpressionNode.cs
- HwndAppCommandInputProvider.cs
- ParserContext.cs
- EntityDesignerDataSourceView.cs
- DataTable.cs
- MasterPageCodeDomTreeGenerator.cs
- ScrollItemProviderWrapper.cs
- Debugger.cs
- CqlBlock.cs
- MaskDescriptor.cs
- rsa.cs
- Light.cs
- ModulesEntry.cs
- QueryExpression.cs
- SchemaImporterExtensionElement.cs
- Constraint.cs
- WebPartConnectVerb.cs
- XmlSchemaObject.cs
- CheckPair.cs
- DBCSCodePageEncoding.cs
- GorillaCodec.cs
- WindowsFont.cs
- tooltip.cs
- SourceFileBuildProvider.cs
- SchemaReference.cs