Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Configuration / System / Configuration / PositiveTimeSpanValidator.cs / 1 / PositiveTimeSpanValidator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Configuration; using System.ComponentModel; namespace System.Configuration { public class PositiveTimeSpanValidator : ConfigurationValidatorBase { public override bool CanValidate(Type type) { return (type == typeof(TimeSpan)); } public override void Validate(object value) { if (value == null) { throw new ArgumentNullException("value"); } if (((TimeSpan)value) <= TimeSpan.Zero) { throw new ArgumentException(SR.GetString(SR.Validator_timespan_value_must_be_positive)); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Configuration; using System.ComponentModel; namespace System.Configuration { public class PositiveTimeSpanValidator : ConfigurationValidatorBase { public override bool CanValidate(Type type) { return (type == typeof(TimeSpan)); } public override void Validate(object value) { if (value == null) { throw new ArgumentNullException("value"); } if (((TimeSpan)value) <= TimeSpan.Zero) { throw new ArgumentException(SR.GetString(SR.Validator_timespan_value_must_be_positive)); } } } } // 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
- AnimationClock.cs
- PrintController.cs
- Misc.cs
- PeerContact.cs
- MessageLoggingElement.cs
- SafeRegistryHandle.cs
- DynamicDocumentPaginator.cs
- BridgeDataReader.cs
- EventProviderWriter.cs
- GraphicsContainer.cs
- StorageSetMapping.cs
- SoapEnumAttribute.cs
- ProtocolImporter.cs
- CheckBoxPopupAdapter.cs
- RecommendedAsConfigurableAttribute.cs
- xmlglyphRunInfo.cs
- CngAlgorithmGroup.cs
- DataGridTablesFactory.cs
- BamlLocalizer.cs
- SrgsGrammar.cs
- AmbientLight.cs
- SectionVisual.cs
- Label.cs
- UshortList2.cs
- KeyValueConfigurationElement.cs
- EntityDataSourceDesignerHelper.cs
- BindingValueChangedEventArgs.cs
- handlecollector.cs
- ExceptionHandler.cs
- InvokeProviderWrapper.cs
- AddInController.cs
- TextEditorDragDrop.cs
- ControlBuilderAttribute.cs
- TimeSpanMinutesConverter.cs
- Calendar.cs
- SrgsItemList.cs
- AssemblyBuilderData.cs
- MasterPageCodeDomTreeGenerator.cs
- OptimalTextSource.cs
- AxImporter.cs
- HttpWebRequestElement.cs
- VectorAnimationUsingKeyFrames.cs
- EventDescriptor.cs
- HashAlgorithm.cs
- XhtmlBasicCalendarAdapter.cs
- HelpKeywordAttribute.cs
- SqlUserDefinedAggregateAttribute.cs
- MdImport.cs
- ObjectSecurity.cs
- ResXResourceSet.cs
- CacheEntry.cs
- LoginAutoFormat.cs
- XmlILStorageConverter.cs
- InternalCache.cs
- ScrollChangedEventArgs.cs
- UrlMapping.cs
- SpecialTypeDataContract.cs
- SHA256Managed.cs
- XsdDataContractImporter.cs
- XmlEntity.cs
- ServerValidateEventArgs.cs
- ObjectDataSourceDisposingEventArgs.cs
- DesignerHelpers.cs
- DataServiceCollectionOfT.cs
- UnwrappedTypesXmlSerializerManager.cs
- MediaCommands.cs
- StyleReferenceConverter.cs
- RenderDataDrawingContext.cs
- ConstraintCollection.cs
- PreviewPageInfo.cs
- SecurityRuntime.cs
- ResourceContainer.cs
- URLString.cs
- EncoderParameters.cs
- ImageField.cs
- CodeLinePragma.cs
- DictionarySectionHandler.cs
- SqlFunctionAttribute.cs
- BasicCellRelation.cs
- CfgRule.cs
- CommittableTransaction.cs
- DataStreamFromComStream.cs
- XmlWrappingReader.cs
- Style.cs
- Utils.cs
- ApplicationFileParser.cs
- SqlCommand.cs
- Validator.cs
- Switch.cs
- CodeTryCatchFinallyStatement.cs
- TextEditorThreadLocalStore.cs
- GlyphRun.cs
- Point.cs
- ApplicationActivator.cs
- xmlfixedPageInfo.cs
- loginstatus.cs
- RichTextBox.cs
- Rfc2898DeriveBytes.cs
- FormatterConverter.cs
- DictionaryEntry.cs