Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- namescope.cs
- TextPointerBase.cs
- ExternalFile.cs
- InvokePatternIdentifiers.cs
- ProviderSettings.cs
- DesignerSerializationManager.cs
- DoubleStorage.cs
- ApplicationCommands.cs
- SafeRegistryHandle.cs
- objectresult_tresulttype.cs
- AttributeQuery.cs
- MethodBuilderInstantiation.cs
- XmlNodeChangedEventArgs.cs
- MetafileHeader.cs
- ComponentConverter.cs
- LeftCellWrapper.cs
- DataConnectionHelper.cs
- FlowDocumentScrollViewer.cs
- DocumentationServerProtocol.cs
- RedirectionProxy.cs
- UpdatePanelTrigger.cs
- AssociationType.cs
- DataGridViewComboBoxColumn.cs
- MediaElement.cs
- Run.cs
- CreateUserWizard.cs
- CmsInterop.cs
- XmlNavigatorStack.cs
- DocumentViewerConstants.cs
- ColorContext.cs
- QualifiedCellIdBoolean.cs
- StrokeNodeOperations.cs
- StylusShape.cs
- LocalizationCodeDomSerializer.cs
- XmlMapping.cs
- XPathNavigatorKeyComparer.cs
- FixedSOMTableCell.cs
- x509store.cs
- XmlSecureResolver.cs
- TransformerInfoCollection.cs
- BypassElementCollection.cs
- Select.cs
- TextDecorationCollection.cs
- Module.cs
- SafeNativeMethods.cs
- CryptographicAttribute.cs
- HMACRIPEMD160.cs
- GZipStream.cs
- MutexSecurity.cs
- DocumentScope.cs
- ToolBarButtonClickEvent.cs
- AspNetHostingPermission.cs
- BindingSourceDesigner.cs
- CssClassPropertyAttribute.cs
- ISFClipboardData.cs
- SyntaxCheck.cs
- SessionEndingEventArgs.cs
- DataGridViewRowConverter.cs
- TemplateEditingVerb.cs
- TempEnvironment.cs
- Win32.cs
- SqlErrorCollection.cs
- ToolStripPanelCell.cs
- RawMouseInputReport.cs
- ExtractorMetadata.cs
- ChannelSinkStacks.cs
- SQLInt32Storage.cs
- ThicknessAnimationUsingKeyFrames.cs
- Oid.cs
- SoapTypeAttribute.cs
- RowBinding.cs
- WebPartEditVerb.cs
- ColorAnimationBase.cs
- ApplicationId.cs
- dtdvalidator.cs
- WindowPattern.cs
- TemplateBaseAction.cs
- ListBoxItemWrapperAutomationPeer.cs
- ModifiableIteratorCollection.cs
- XmlAttributeOverrides.cs
- ControllableStoryboardAction.cs
- TextViewBase.cs
- TextElementCollection.cs
- hwndwrapper.cs
- ILGenerator.cs
- CookielessData.cs
- TemplatePartAttribute.cs
- WebPartDesigner.cs
- NetworkInformationPermission.cs
- BaseComponentEditor.cs
- BaseAsyncResult.cs
- ConnectionStringSettings.cs
- BuilderPropertyEntry.cs
- BitmapEffectInputData.cs
- HostedHttpContext.cs
- RemoteWebConfigurationHost.cs
- EpmContentDeSerializerBase.cs
- IdentityReference.cs
- EventsTab.cs
- CustomErrorsSectionWrapper.cs