Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / LongValidatorAttribute.cs / 1305376 / LongValidatorAttribute.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 LongValidatorAttribute : ConfigurationValidatorAttribute { private long _min = long.MinValue; private long _max = long.MaxValue; private bool _excludeRange = false; public override ConfigurationValidatorBase ValidatorInstance { get { return new LongValidator(_min, _max, _excludeRange); } } public LongValidatorAttribute() { } public long MinValue { get { return _min; } set { if (_max < value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _min = value; } } public long 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 LongValidatorAttribute : ConfigurationValidatorAttribute { private long _min = long.MinValue; private long _max = long.MaxValue; private bool _excludeRange = false; public override ConfigurationValidatorBase ValidatorInstance { get { return new LongValidator(_min, _max, _excludeRange); } } public LongValidatorAttribute() { } public long MinValue { get { return _min; } set { if (_max < value) { throw new ArgumentOutOfRangeException("value", SR.GetString(SR.Validator_min_greater_than_max)); } _min = value; } } public long 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
- ConstraintManager.cs
- MetadataItemSerializer.cs
- StreamingContext.cs
- StylusCaptureWithinProperty.cs
- _ListenerResponseStream.cs
- AppDomain.cs
- DataGridViewRowCollection.cs
- NavigationCommands.cs
- ProtectedConfigurationSection.cs
- validationstate.cs
- IDReferencePropertyAttribute.cs
- FormViewCommandEventArgs.cs
- CurrencyWrapper.cs
- HttpApplication.cs
- MessageQueuePermission.cs
- ProcessInputEventArgs.cs
- SRDisplayNameAttribute.cs
- PageThemeBuildProvider.cs
- SQLBytesStorage.cs
- MonthCalendarDesigner.cs
- SecurityTokenAuthenticator.cs
- X509Certificate2Collection.cs
- Paragraph.cs
- RoutedCommand.cs
- Relationship.cs
- MD5CryptoServiceProvider.cs
- ProxyWebPartManager.cs
- FormatConvertedBitmap.cs
- ListViewAutomationPeer.cs
- WebPartUtil.cs
- WebHostedComPlusServiceHost.cs
- XmlValueConverter.cs
- CommonXSendMessage.cs
- WindowsFormsHelpers.cs
- ProcessInfo.cs
- ParseElement.cs
- FormsAuthenticationUser.cs
- TrackingMemoryStreamFactory.cs
- ClientSponsor.cs
- IdentityManager.cs
- WindowsGraphicsCacheManager.cs
- TreeNodeEventArgs.cs
- EventProxy.cs
- ContextMenuAutomationPeer.cs
- CodeDelegateInvokeExpression.cs
- ParsedAttributeCollection.cs
- OdbcException.cs
- GridItem.cs
- KeyConstraint.cs
- ImageField.cs
- ResourceIDHelper.cs
- MsmqHostedTransportManager.cs
- AvtEvent.cs
- CodeStatementCollection.cs
- TextStore.cs
- ResolveMatchesMessageCD1.cs
- PolyBezierSegmentFigureLogic.cs
- SqlMethodAttribute.cs
- Internal.cs
- WebBrowserNavigatedEventHandler.cs
- ObjectStorage.cs
- AdornedElementPlaceholder.cs
- DrawingServices.cs
- ListBox.cs
- SiteMapDataSource.cs
- TickBar.cs
- AdRotator.cs
- TextEditorContextMenu.cs
- EventMap.cs
- PtsHelper.cs
- RangeExpression.cs
- RecognizerStateChangedEventArgs.cs
- DefinitionBase.cs
- URL.cs
- WebPartDisplayModeCollection.cs
- CustomAttributeFormatException.cs
- RC2CryptoServiceProvider.cs
- GetCertificateRequest.cs
- VarInfo.cs
- FileUtil.cs
- LocatorGroup.cs
- BmpBitmapEncoder.cs
- StylusPoint.cs
- FrameworkObject.cs
- TdsParameterSetter.cs
- SamlAuthorizationDecisionStatement.cs
- GlyphInfoList.cs
- SatelliteContractVersionAttribute.cs
- SelfIssuedAuthProofToken.cs
- InvalidCastException.cs
- SingleConverter.cs
- TextBoxAutoCompleteSourceConverter.cs
- ToolboxItemFilterAttribute.cs
- BaseServiceProvider.cs
- TCPClient.cs
- shaperfactoryquerycachekey.cs
- WebPartDisplayModeEventArgs.cs
- List.cs
- HashSetEqualityComparer.cs
- SafeCryptContextHandle.cs