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
- DelegateSerializationHolder.cs
- ValidationSummary.cs
- TextContainer.cs
- PrefixQName.cs
- EFDataModelProvider.cs
- ToolStripOverflow.cs
- XmlCompatibilityReader.cs
- ModifiableIteratorCollection.cs
- UniqueEventHelper.cs
- InplaceBitmapMetadataWriter.cs
- ImageListImageEditor.cs
- CapabilitiesPattern.cs
- HashJoinQueryOperatorEnumerator.cs
- TypeContext.cs
- TreeNodeEventArgs.cs
- TextLineResult.cs
- StylusCollection.cs
- ObjectViewFactory.cs
- RSAPKCS1SignatureDeformatter.cs
- BypassElementCollection.cs
- RequiredAttributeAttribute.cs
- PictureBox.cs
- LinqDataSourceHelper.cs
- DrawListViewColumnHeaderEventArgs.cs
- EntityParameterCollection.cs
- XmlRootAttribute.cs
- HtmlButton.cs
- PointAnimation.cs
- Properties.cs
- TextTreeTextBlock.cs
- ClrProviderManifest.cs
- PrePrepareMethodAttribute.cs
- DataFormats.cs
- webeventbuffer.cs
- BasePattern.cs
- NavigateEvent.cs
- DropShadowBitmapEffect.cs
- TrackingServices.cs
- PasswordRecovery.cs
- Pair.cs
- AsyncResult.cs
- AttributeAction.cs
- MailMessageEventArgs.cs
- StorageMappingItemCollection.cs
- UnsafeNativeMethods.cs
- ListViewDeletedEventArgs.cs
- ChannelReliableSession.cs
- Cursors.cs
- TextViewDesigner.cs
- OperationExecutionFault.cs
- ModelTreeEnumerator.cs
- Span.cs
- MessageSmuggler.cs
- IMembershipProvider.cs
- ParserContext.cs
- SiteMapNodeCollection.cs
- TCPClient.cs
- WmfPlaceableFileHeader.cs
- ServiceReference.cs
- DataSetUtil.cs
- DomainUpDown.cs
- LateBoundBitmapDecoder.cs
- SQLConvert.cs
- RecognitionEventArgs.cs
- ScriptComponentDescriptor.cs
- XmlUnspecifiedAttribute.cs
- MetadataCollection.cs
- GraphicsState.cs
- XmlDataSourceView.cs
- SqlCacheDependencyDatabase.cs
- ZoneMembershipCondition.cs
- SvcMapFile.cs
- SizeAnimationClockResource.cs
- ListDictionary.cs
- TimelineGroup.cs
- Clock.cs
- diagnosticsswitches.cs
- FrameSecurityDescriptor.cs
- VisualCollection.cs
- FileChangesMonitor.cs
- AlphaSortedEnumConverter.cs
- Size3DValueSerializer.cs
- StickyNoteContentControl.cs
- HttpRequestMessageProperty.cs
- HostedImpersonationContext.cs
- RenderingBiasValidation.cs
- SimpleBitVector32.cs
- IDQuery.cs
- WinCategoryAttribute.cs
- StickyNoteContentControl.cs
- XmlResolver.cs
- LabelLiteral.cs
- NativeObjectSecurity.cs
- HashCodeCombiner.cs
- PrincipalPermissionMode.cs
- StringComparer.cs
- ContextBase.cs
- xamlnodes.cs
- ProxyGenerator.cs
- EmptyEnumerable.cs