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 / 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
- OutputBuffer.cs
- NumberFunctions.cs
- input.cs
- ImageSourceValueSerializer.cs
- DockPanel.cs
- TextBoxView.cs
- TakeQueryOptionExpression.cs
- EnlistmentState.cs
- HttpRequestWrapper.cs
- ParallelSeparator.xaml.cs
- MarkupWriter.cs
- XmlWellformedWriterHelpers.cs
- DesignTimeParseData.cs
- ResourcePool.cs
- CachedFontFamily.cs
- VerificationAttribute.cs
- SqlFactory.cs
- unitconverter.cs
- FormClosingEvent.cs
- NavigatingCancelEventArgs.cs
- EtwTrace.cs
- HashCodeCombiner.cs
- XmlCompatibilityReader.cs
- UndoManager.cs
- ProfileService.cs
- OleDbException.cs
- ProfileSection.cs
- ContainerTracking.cs
- WindowsStatic.cs
- RuntimeConfigLKG.cs
- InvalidPrinterException.cs
- StringAnimationBase.cs
- InvalidPropValue.cs
- HttpCookieCollection.cs
- XmlSchemaSimpleTypeList.cs
- Size.cs
- Header.cs
- MetafileHeaderWmf.cs
- CharStorage.cs
- TextTreeInsertUndoUnit.cs
- DictionaryItemsCollection.cs
- OdbcException.cs
- X509Chain.cs
- DetailsViewPageEventArgs.cs
- NaturalLanguageHyphenator.cs
- PagesSection.cs
- DataMember.cs
- FrameworkContentElement.cs
- MediaTimeline.cs
- mda.cs
- TransportElement.cs
- SspiSecurityTokenProvider.cs
- FixedTextPointer.cs
- DataRelationPropertyDescriptor.cs
- BigInt.cs
- Process.cs
- FreezableDefaultValueFactory.cs
- ByteStreamGeometryContext.cs
- SQLConvert.cs
- QueryInterceptorAttribute.cs
- TriggerActionCollection.cs
- XmlSchemaObject.cs
- GridSplitter.cs
- ReaderWriterLockWrapper.cs
- HandlerWithFactory.cs
- Rect3D.cs
- MinMaxParagraphWidth.cs
- PointUtil.cs
- GeneralTransform3DTo2D.cs
- PasswordBoxAutomationPeer.cs
- util.cs
- HttpException.cs
- login.cs
- AxisAngleRotation3D.cs
- ListViewCommandEventArgs.cs
- XmlNamespaceMappingCollection.cs
- CapiSafeHandles.cs
- SspiSecurityToken.cs
- LinkGrep.cs
- TextServicesCompartmentContext.cs
- TransformerInfoCollection.cs
- ToolStripArrowRenderEventArgs.cs
- NetTcpSection.cs
- RepeatInfo.cs
- Axis.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- OrderingExpression.cs
- ComboBox.cs
- CodeDirectiveCollection.cs
- TextServicesProperty.cs
- KerberosTicketHashIdentifierClause.cs
- SQLDoubleStorage.cs
- StringSorter.cs
- XmlSchemaSimpleTypeRestriction.cs
- ThemeDirectoryCompiler.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- DBSqlParser.cs
- ILGenerator.cs
- embossbitmapeffect.cs
- AuthenticationSchemesHelper.cs