Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- CredentialCache.cs
- ObjectSecurity.cs
- CurrencyManager.cs
- WebPartEditorCancelVerb.cs
- RawKeyboardInputReport.cs
- ReflectEventDescriptor.cs
- WindowsFormsLinkLabel.cs
- DynamicDataRoute.cs
- Parser.cs
- StorageInfo.cs
- StyleTypedPropertyAttribute.cs
- BaseComponentEditor.cs
- NamespaceCollection.cs
- Decoder.cs
- FrameworkElement.cs
- ToolStripSystemRenderer.cs
- ObjectDataSourceWizardForm.cs
- XpsFilter.cs
- SettingsPropertyNotFoundException.cs
- CounterSampleCalculator.cs
- ExpressionEditorAttribute.cs
- OracleColumn.cs
- XamlInt32CollectionSerializer.cs
- Property.cs
- BufferedGraphics.cs
- Rect3D.cs
- ValidationSummary.cs
- Size3D.cs
- FlowNode.cs
- Int16.cs
- TrustSection.cs
- Vector3DCollection.cs
- returneventsaver.cs
- DBCommand.cs
- ExpressionPrefixAttribute.cs
- PostBackOptions.cs
- PassportIdentity.cs
- ListDictionary.cs
- SerializerDescriptor.cs
- EdgeProfileValidation.cs
- TreeViewDataItemAutomationPeer.cs
- BitmapSource.cs
- XslAst.cs
- PageStatePersister.cs
- SymbolUsageManager.cs
- BuildProviderAppliesToAttribute.cs
- ReadWriteSpinLock.cs
- ListControl.cs
- ReadWriteObjectLock.cs
- TrackingProfileSerializer.cs
- TableLayoutSettings.cs
- ItemCheckedEvent.cs
- COM2ExtendedBrowsingHandler.cs
- MarshalByValueComponent.cs
- IndexingContentUnit.cs
- DataKeyCollection.cs
- WebPartEventArgs.cs
- EqualityArray.cs
- SignatureToken.cs
- SortKey.cs
- ProviderSettings.cs
- RegexTree.cs
- SplitterEvent.cs
- figurelengthconverter.cs
- DataGridViewDataConnection.cs
- TracingConnectionListener.cs
- SqlDependency.cs
- IApplicationTrustManager.cs
- sqlmetadatafactory.cs
- MobileTextWriter.cs
- Rfc2898DeriveBytes.cs
- Expression.cs
- DataSourceSelectArguments.cs
- ValueUnavailableException.cs
- TargetException.cs
- XmlDownloadManager.cs
- SchemaCollectionCompiler.cs
- DataMisalignedException.cs
- DataException.cs
- ImageMetadata.cs
- AuthenticationModuleElementCollection.cs
- WpfWebRequestHelper.cs
- ReturnType.cs
- SqlDataAdapter.cs
- RelationshipDetailsRow.cs
- CodeArrayIndexerExpression.cs
- SequentialWorkflowHeaderFooter.cs
- _NTAuthentication.cs
- ScrollBarRenderer.cs
- ConstraintEnumerator.cs
- XmlSchemaAny.cs
- MemoryPressure.cs
- OverlappedContext.cs
- DataViewSettingCollection.cs
- X509IssuerSerialKeyIdentifierClause.cs
- CodeCommentStatementCollection.cs
- AutomationProperties.cs
- FixedSOMLineRanges.cs
- BrowserCapabilitiesCompiler.cs
- SHA384CryptoServiceProvider.cs