Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- CompoundFileReference.cs
- QueueSurrogate.cs
- DateTimeOffsetAdapter.cs
- UrlAuthorizationModule.cs
- MenuItemBinding.cs
- ObjectDataSourceDesigner.cs
- WinInetCache.cs
- xml.cs
- CssStyleCollection.cs
- StringFreezingAttribute.cs
- FlowDocumentReader.cs
- TypeDelegator.cs
- CheckBoxBaseAdapter.cs
- TreeViewItem.cs
- EncryptedPackageFilter.cs
- VoiceObjectToken.cs
- VisualBasicSettingsConverter.cs
- TextViewSelectionProcessor.cs
- SmtpDateTime.cs
- PathGradientBrush.cs
- DataProviderNameConverter.cs
- ExpressionNode.cs
- PrintingPermission.cs
- CookielessData.cs
- DataObjectCopyingEventArgs.cs
- RedirectionProxy.cs
- EventLogPermission.cs
- MainMenu.cs
- TypeContext.cs
- WebSysDefaultValueAttribute.cs
- DataGridPageChangedEventArgs.cs
- ManualResetEvent.cs
- DispatcherProcessingDisabled.cs
- FlowPosition.cs
- CaseStatementSlot.cs
- WMICapabilities.cs
- OracleCommand.cs
- ViewManagerAttribute.cs
- Gdiplus.cs
- FixedTextContainer.cs
- EditingCoordinator.cs
- ByteAnimationBase.cs
- XMLDiffLoader.cs
- EditorZoneBase.cs
- DocumentXPathNavigator.cs
- DictionaryContent.cs
- ListBoxItemAutomationPeer.cs
- ScriptingSectionGroup.cs
- CodeTypeMember.cs
- DesignBindingEditor.cs
- SqlTransaction.cs
- FormsAuthenticationConfiguration.cs
- ThreadAttributes.cs
- Point.cs
- WebPartRestoreVerb.cs
- Missing.cs
- FontFamilyConverter.cs
- StrongNameKeyPair.cs
- XmlConvert.cs
- PlacementWorkspace.cs
- TemplateControl.cs
- IfAction.cs
- DesignConnectionCollection.cs
- ControlCachePolicy.cs
- OleDbReferenceCollection.cs
- DataGridViewHitTestInfo.cs
- QueryComponents.cs
- UriSectionReader.cs
- ExpressionsCollectionEditor.cs
- DesignRelation.cs
- TextAnchor.cs
- D3DImage.cs
- SmiSettersStream.cs
- HtmlInputRadioButton.cs
- MimeTypeAttribute.cs
- CachedRequestParams.cs
- DiscreteKeyFrames.cs
- unitconverter.cs
- DbInsertCommandTree.cs
- contentDescriptor.cs
- PrimaryKeyTypeConverter.cs
- DeploymentSectionCache.cs
- Debug.cs
- CellLabel.cs
- ContextMarshalException.cs
- ObfuscateAssemblyAttribute.cs
- RowCache.cs
- ScriptComponentDescriptor.cs
- IdentifierElement.cs
- GridViewDeleteEventArgs.cs
- TabletDeviceInfo.cs
- FaultContractInfo.cs
- SuppressMessageAttribute.cs
- AudioFormatConverter.cs
- XmlReaderDelegator.cs
- TagElement.cs
- DiscoveryDocumentLinksPattern.cs
- ColumnMapTranslator.cs
- Policy.cs
- AxisAngleRotation3D.cs