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
- HttpRawResponse.cs
- HtmlInputControl.cs
- Crc32Helper.cs
- WebHeaderCollection.cs
- WebPartCollection.cs
- DataReaderContainer.cs
- Int32Rect.cs
- StringWriter.cs
- SHA384.cs
- Message.cs
- Registry.cs
- BinaryConverter.cs
- SnapLine.cs
- AlignmentXValidation.cs
- COM2AboutBoxPropertyDescriptor.cs
- TemplateComponentConnector.cs
- HostingEnvironmentException.cs
- XslNumber.cs
- ExitEventArgs.cs
- DataControlFieldCollection.cs
- ObjectListItemCollection.cs
- DataGridViewHitTestInfo.cs
- BufferedStream2.cs
- FormClosingEvent.cs
- InheritanceRules.cs
- WrappedIUnknown.cs
- WebResourceUtil.cs
- TextElementCollection.cs
- WebSysDisplayNameAttribute.cs
- AssemblyInfo.cs
- UpdateTracker.cs
- EditModeSwitchButton.cs
- ServicePointManager.cs
- WebPartTransformer.cs
- BufferedReadStream.cs
- DataGridViewCellParsingEventArgs.cs
- ProxyWebPartConnectionCollection.cs
- Form.cs
- ObjectStateManagerMetadata.cs
- GenericAuthenticationEventArgs.cs
- ToolStrip.cs
- RTLAwareMessageBox.cs
- SecurityException.cs
- NetMsmqSecurityMode.cs
- WmlTextViewAdapter.cs
- ACL.cs
- SafeRegistryHandle.cs
- GuidConverter.cs
- HostedTransportConfigurationBase.cs
- FactoryRecord.cs
- DesignSurfaceEvent.cs
- ToolStripSplitStackLayout.cs
- DesignerEditorPartChrome.cs
- BitFlagsGenerator.cs
- DictionaryChange.cs
- SafeNativeMethods.cs
- AudioException.cs
- NumericExpr.cs
- ScriptControl.cs
- XhtmlBasicPanelAdapter.cs
- NameValuePermission.cs
- HttpCookiesSection.cs
- XPathNavigator.cs
- TypeUsage.cs
- DataSvcMapFileSerializer.cs
- SerialPort.cs
- OleDbTransaction.cs
- MapPathBasedVirtualPathProvider.cs
- DrawingAttributesDefaultValueFactory.cs
- Vector3DValueSerializer.cs
- DataGridPagerStyle.cs
- MSAANativeProvider.cs
- XmlObjectSerializerWriteContext.cs
- RandomNumberGenerator.cs
- SinglePageViewer.cs
- DocumentApplicationState.cs
- PropertyValue.cs
- StructuralComparisons.cs
- SHA512.cs
- RunInstallerAttribute.cs
- SizeAnimationBase.cs
- TemplateXamlTreeBuilder.cs
- RewritingProcessor.cs
- RangeContentEnumerator.cs
- ToolStripLocationCancelEventArgs.cs
- StackBuilderSink.cs
- AddInStore.cs
- _SslStream.cs
- DataGridViewCheckBoxColumn.cs
- XmlCodeExporter.cs
- TextRangeEdit.cs
- ApplicationSettingsBase.cs
- FactoryGenerator.cs
- SecurityKeyType.cs
- HandoffBehavior.cs
- BindingOperations.cs
- XmlSchemaObject.cs
- DirectoryObjectSecurity.cs
- EntityTypeBase.cs
- Tuple.cs