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
- SafeArchiveContext.cs
- ReadOnlyCollection.cs
- RemotingAttributes.cs
- FormsAuthenticationCredentials.cs
- SystemEvents.cs
- TimeEnumHelper.cs
- SchemaNotation.cs
- TypeTypeConverter.cs
- XamlPointCollectionSerializer.cs
- HostProtectionException.cs
- DockAndAnchorLayout.cs
- ArrayWithOffset.cs
- EditingScopeUndoUnit.cs
- SqlDataSourceStatusEventArgs.cs
- GenericAuthenticationEventArgs.cs
- DebugViewWriter.cs
- XmlLangPropertyAttribute.cs
- CryptoConfig.cs
- ListItemConverter.cs
- Int16AnimationUsingKeyFrames.cs
- _AutoWebProxyScriptWrapper.cs
- FieldTemplateUserControl.cs
- AdCreatedEventArgs.cs
- DataGridViewCellValueEventArgs.cs
- _BaseOverlappedAsyncResult.cs
- XPathAxisIterator.cs
- SafeCryptHandles.cs
- DLinqDataModelProvider.cs
- EncryptedPackageFilter.cs
- ProfessionalColors.cs
- DependencyPropertyKey.cs
- ping.cs
- CssClassPropertyAttribute.cs
- PhysicalFontFamily.cs
- PrintDialog.cs
- CopyOfAction.cs
- XmlBinaryWriterSession.cs
- HandleCollector.cs
- XPathCompileException.cs
- UserPreferenceChangedEventArgs.cs
- TextEditorLists.cs
- StringToken.cs
- Style.cs
- CqlParserHelpers.cs
- Relationship.cs
- BinaryUtilClasses.cs
- ErrorInfoXmlDocument.cs
- FloatUtil.cs
- XmlChoiceIdentifierAttribute.cs
- RenderingEventArgs.cs
- Literal.cs
- XPathAxisIterator.cs
- OpCellTreeNode.cs
- PackagePart.cs
- RadioButtonRenderer.cs
- SQLInt64Storage.cs
- Rules.cs
- CacheMemory.cs
- SafeLibraryHandle.cs
- NetworkInterface.cs
- StylusEventArgs.cs
- AuthorizationRuleCollection.cs
- DataChangedEventManager.cs
- ContentTextAutomationPeer.cs
- DataGridViewLinkColumn.cs
- RelationshipNavigation.cs
- EventLogEntry.cs
- SerializableTypeCodeDomSerializer.cs
- ScrollItemProviderWrapper.cs
- BrowserInteropHelper.cs
- FlowchartDesigner.xaml.cs
- AttributeEmitter.cs
- Int16Animation.cs
- CodeGeneratorOptions.cs
- XmlSchemaComplexContentExtension.cs
- BitmapPalettes.cs
- CustomAttribute.cs
- XmlNamespaceMappingCollection.cs
- RegistryPermission.cs
- StylusPointPropertyInfoDefaults.cs
- QilFactory.cs
- ModifiableIteratorCollection.cs
- RowType.cs
- InfocardExtendedInformationCollection.cs
- DatatypeImplementation.cs
- MenuAutomationPeer.cs
- listitem.cs
- SqlIdentifier.cs
- URLAttribute.cs
- AlternateViewCollection.cs
- ProviderSettings.cs
- WebBrowserNavigatingEventHandler.cs
- SpanIndex.cs
- XmlAutoDetectWriter.cs
- QueueProcessor.cs
- BasePattern.cs
- FieldAccessException.cs
- NonSerializedAttribute.cs
- PolyLineSegment.cs
- BaseAsyncResult.cs