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 / LongValidatorAttribute.cs / 1 / 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
- StateInitialization.cs
- AddInPipelineAttributes.cs
- HTMLTextWriter.cs
- Native.cs
- StackSpiller.Temps.cs
- XmlNodeChangedEventManager.cs
- KoreanCalendar.cs
- AssemblyNameProxy.cs
- Ref.cs
- MessageBox.cs
- WsdlExporter.cs
- ArgumentFixer.cs
- HtmlInputText.cs
- ConditionBrowserDialog.cs
- StringResourceManager.cs
- RotateTransform.cs
- PowerModeChangedEventArgs.cs
- TransportBindingElement.cs
- BmpBitmapEncoder.cs
- Int64AnimationBase.cs
- TTSEvent.cs
- ToolStripSystemRenderer.cs
- DispatcherObject.cs
- PointAnimationBase.cs
- WorkflowItemPresenter.cs
- AuthenticationConfig.cs
- StoreItemCollection.cs
- ModulesEntry.cs
- assertwrapper.cs
- NotifyIcon.cs
- Visual3D.cs
- uribuilder.cs
- Sentence.cs
- ConfigurationSectionGroupCollection.cs
- MergeLocalizationDirectives.cs
- Number.cs
- AuthenticationException.cs
- SafeReadContext.cs
- Brush.cs
- SqlClientWrapperSmiStream.cs
- Converter.cs
- ProxyWebPart.cs
- OpCodes.cs
- BaseValidator.cs
- ScalarType.cs
- PLINQETWProvider.cs
- SignatureHelper.cs
- LinkLabelLinkClickedEvent.cs
- OptimizedTemplateContent.cs
- ApplicationFileCodeDomTreeGenerator.cs
- TrackingParameters.cs
- RemotingServices.cs
- MsmqTransportSecurityElement.cs
- PrintPreviewDialog.cs
- Screen.cs
- Expander.cs
- DynamicPropertyReader.cs
- DiscoveryClientBindingElement.cs
- ZipIOCentralDirectoryFileHeader.cs
- OleDbConnectionFactory.cs
- Header.cs
- RuntimeHelpers.cs
- TraversalRequest.cs
- X509Extension.cs
- XsdBuildProvider.cs
- StatusStrip.cs
- X509UI.cs
- CanonicalFormWriter.cs
- Dispatcher.cs
- DesignerLoader.cs
- AssemblyAttributesGoHere.cs
- PointAnimationClockResource.cs
- AlternateView.cs
- DbProviderManifest.cs
- CreateInstanceBinder.cs
- AsyncDataRequest.cs
- FixedSOMTableRow.cs
- __Error.cs
- StrokeCollectionConverter.cs
- SQLDecimalStorage.cs
- ColumnHeaderConverter.cs
- EdmItemCollection.cs
- ScriptingProfileServiceSection.cs
- GroupedContextMenuStrip.cs
- SafeSystemMetrics.cs
- PropertyPathWorker.cs
- ObjectHelper.cs
- TCPClient.cs
- CodeIdentifiers.cs
- CodeExporter.cs
- SerialErrors.cs
- WriteFileContext.cs
- EdmSchemaError.cs
- DataRowComparer.cs
- MemberInfoSerializationHolder.cs
- DomNameTable.cs
- RtfControls.cs
- RTLAwareMessageBox.cs
- UsernameTokenFactoryCredential.cs
- KeyTime.cs