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
- CommandHelpers.cs
- PathFigureCollectionValueSerializer.cs
- CapabilitiesSection.cs
- EFAssociationProvider.cs
- PointConverter.cs
- OleDbCommand.cs
- WebConfigurationFileMap.cs
- formatter.cs
- OleDbWrapper.cs
- xamlnodes.cs
- CompilerCollection.cs
- CookieParameter.cs
- TreeNodeBindingCollection.cs
- MD5Cng.cs
- GridViewPageEventArgs.cs
- ApplicationSecurityInfo.cs
- QueryResponse.cs
- FilePrompt.cs
- TemplatedMailWebEventProvider.cs
- DbInsertCommandTree.cs
- InputLanguageManager.cs
- DataGridViewAddColumnDialog.cs
- TargetInvocationException.cs
- SqlTypesSchemaImporter.cs
- Dictionary.cs
- MenuItemBindingCollection.cs
- Transactions.cs
- TableDetailsCollection.cs
- EntityViewGenerationConstants.cs
- MachineKeySection.cs
- CapiNative.cs
- FormCollection.cs
- DataSourceControlBuilder.cs
- ConfigurationPropertyCollection.cs
- SQLConvert.cs
- RawAppCommandInputReport.cs
- MLangCodePageEncoding.cs
- Error.cs
- ADRole.cs
- PathBox.cs
- ValueProviderWrapper.cs
- XmlCodeExporter.cs
- HandlerBase.cs
- FixedSOMElement.cs
- HttpHandlerActionCollection.cs
- MdImport.cs
- SocketElement.cs
- FixedTextPointer.cs
- LabelAutomationPeer.cs
- StringReader.cs
- WebPartConnectVerb.cs
- AuthStoreRoleProvider.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- InplaceBitmapMetadataWriter.cs
- TypeContext.cs
- SHA256.cs
- QueuePropertyVariants.cs
- SchemaObjectWriter.cs
- StringUtil.cs
- GeneralTransformCollection.cs
- MessageFormatterConverter.cs
- Inline.cs
- PropertyGroupDescription.cs
- XmlChildEnumerator.cs
- _ProxyChain.cs
- ProxyHelper.cs
- UnconditionalPolicy.cs
- safex509handles.cs
- RelatedPropertyManager.cs
- TableLayoutSettingsTypeConverter.cs
- FormViewCommandEventArgs.cs
- SByteStorage.cs
- Size.cs
- StrokeIntersection.cs
- XmlEncoding.cs
- SerializerProvider.cs
- MSAAWinEventWrap.cs
- XXXInfos.cs
- Utils.cs
- ModelTreeEnumerator.cs
- ProfileModule.cs
- PropertyMetadata.cs
- StateItem.cs
- OrderedDictionary.cs
- RecordConverter.cs
- FormsAuthenticationModule.cs
- DataGridViewUtilities.cs
- ResourceDisplayNameAttribute.cs
- DecoderFallback.cs
- FixedSOMContainer.cs
- ProxyWebPartManagerDesigner.cs
- NoPersistScope.cs
- DataAdapter.cs
- VoiceSynthesis.cs
- EllipticalNodeOperations.cs
- TraceSwitch.cs
- MarshalByRefObject.cs
- IPHostEntry.cs
- ToolStripItemTextRenderEventArgs.cs
- BinaryUtilClasses.cs