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
- DBConnectionString.cs
- TypeUtils.cs
- AttributeXamlType.cs
- BamlRecordHelper.cs
- GridProviderWrapper.cs
- TagPrefixCollection.cs
- TextEditorMouse.cs
- RoutedEventValueSerializer.cs
- BinaryMethodMessage.cs
- SqlTriggerAttribute.cs
- ChildChangedEventArgs.cs
- PermissionRequestEvidence.cs
- ImageBrush.cs
- SimpleWebHandlerParser.cs
- UrlPath.cs
- MenuItemBinding.cs
- xsdvalidator.cs
- SerializationObjectManager.cs
- NamespaceMapping.cs
- MetadataCache.cs
- HandlerBase.cs
- NavigationEventArgs.cs
- ObjRef.cs
- SoapAttributeAttribute.cs
- CodeTypeConstructor.cs
- EmptyEnumerator.cs
- TextBox.cs
- DesignerVerb.cs
- AutomationPattern.cs
- ColorConvertedBitmapExtension.cs
- XmlTextAttribute.cs
- Logging.cs
- MeasureData.cs
- Win32.cs
- DataGridViewCheckBoxCell.cs
- FontCacheLogic.cs
- KeySpline.cs
- PasswordTextContainer.cs
- IBuiltInEvidence.cs
- Soap.cs
- ValueConversionAttribute.cs
- SSmlParser.cs
- SizeAnimationUsingKeyFrames.cs
- DiagnosticTrace.cs
- ClockController.cs
- LightweightCodeGenerator.cs
- URLMembershipCondition.cs
- BindingManagerDataErrorEventArgs.cs
- MSHTMLHostUtil.cs
- StorageConditionPropertyMapping.cs
- SqlConnectionStringBuilder.cs
- SpanIndex.cs
- BooleanConverter.cs
- LocalBuilder.cs
- XmlUtil.cs
- ImmutableObjectAttribute.cs
- PartialList.cs
- DataGridViewColumnEventArgs.cs
- AutoResetEvent.cs
- HtmlTextArea.cs
- SqlAliaser.cs
- SpellerInterop.cs
- InstanceOwnerException.cs
- WSHttpBindingCollectionElement.cs
- CombinedGeometry.cs
- XsdDataContractExporter.cs
- DependencyPropertyAttribute.cs
- SoundPlayer.cs
- ContentPresenter.cs
- MatrixTransform3D.cs
- DocumentReference.cs
- XmlFormatExtensionAttribute.cs
- SerializerDescriptor.cs
- WindowsFormsHelpers.cs
- UnionQueryOperator.cs
- CodeArgumentReferenceExpression.cs
- BaseUriHelper.cs
- EntityDataSourceMemberPath.cs
- BlurBitmapEffect.cs
- CompositeCollection.cs
- Thumb.cs
- WaitHandle.cs
- TypedTableHandler.cs
- XmlWriterTraceListener.cs
- ObjectItemConventionAssemblyLoader.cs
- X509ThumbprintKeyIdentifierClause.cs
- XmlImplementation.cs
- ConnectionInterfaceCollection.cs
- TraceProvider.cs
- XmlAutoDetectWriter.cs
- PathData.cs
- securitymgrsite.cs
- ExpanderAutomationPeer.cs
- PanelDesigner.cs
- TypeExtensionSerializer.cs
- RelatedEnd.cs
- GeneralTransform.cs
- MappingModelBuildProvider.cs
- Blend.cs
- GlobalizationSection.cs