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
- EntityDataSourceWrapperPropertyDescriptor.cs
- TransactionManagerProxy.cs
- DataGridLength.cs
- Label.cs
- ObjectItemNoOpAssemblyLoader.cs
- followingsibling.cs
- DbConnectionPoolGroupProviderInfo.cs
- RegularExpressionValidator.cs
- SchemaDeclBase.cs
- SpeechRecognizer.cs
- SamlConstants.cs
- RemoteWebConfigurationHost.cs
- PackagePart.cs
- XmlSchemaChoice.cs
- XamlTypeMapperSchemaContext.cs
- SelectionPattern.cs
- ApplicationSecurityManager.cs
- ClientBuildManagerCallback.cs
- ConfigurationValidatorAttribute.cs
- SignedXml.cs
- PropertyTabAttribute.cs
- TextRangeAdaptor.cs
- KeyEventArgs.cs
- OpenTypeLayout.cs
- BooleanConverter.cs
- ComEventsHelper.cs
- SByteConverter.cs
- JsonEnumDataContract.cs
- CodeNamespaceCollection.cs
- HttpRawResponse.cs
- manifestimages.cs
- PtsHost.cs
- _CacheStreams.cs
- Color.cs
- ObjectDataSource.cs
- RuntimeArgumentHandle.cs
- ThreadExceptionDialog.cs
- UserPersonalizationStateInfo.cs
- DesignParameter.cs
- SocketException.cs
- RepeaterDataBoundAdapter.cs
- ConfigPathUtility.cs
- FrameworkContextData.cs
- FlowLayoutSettings.cs
- ObjectSecurity.cs
- ConstraintStruct.cs
- MenuAutomationPeer.cs
- BitmapData.cs
- TagPrefixInfo.cs
- MailHeaderInfo.cs
- DataColumnMapping.cs
- WindowsNonControl.cs
- GridViewRowCollection.cs
- JournalEntryStack.cs
- Timer.cs
- AspNetSynchronizationContext.cs
- SystemDropShadowChrome.cs
- ServiceReflector.cs
- ThreadExceptionDialog.cs
- XmlSchemaAnnotated.cs
- ComponentEditorForm.cs
- PropertyCollection.cs
- LayoutUtils.cs
- PersistenceTypeAttribute.cs
- Mapping.cs
- SqlNotificationRequest.cs
- CommandManager.cs
- LicenseContext.cs
- WsatStrings.cs
- InputReport.cs
- LineBreakRecord.cs
- AnnotationService.cs
- NameTable.cs
- DataSourceGroupCollection.cs
- EventlogProvider.cs
- HttpServerVarsCollection.cs
- MatrixKeyFrameCollection.cs
- WindowCollection.cs
- TraceFilter.cs
- SocketException.cs
- SerializableAttribute.cs
- SiteMapDataSource.cs
- SafeWaitHandle.cs
- MouseButtonEventArgs.cs
- XmlAtomErrorReader.cs
- DataMisalignedException.cs
- MSG.cs
- AxWrapperGen.cs
- ByteConverter.cs
- DataExpression.cs
- GeneralTransform2DTo3DTo2D.cs
- InfiniteTimeSpanConverter.cs
- DataContractSerializerMessageContractImporter.cs
- TreeWalker.cs
- AppDomainProtocolHandler.cs
- Command.cs
- MouseCaptureWithinProperty.cs
- StyleXamlParser.cs
- CharEnumerator.cs
- DocumentReference.cs