Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / PositiveTimeSpanValidator.cs / 1305376 / 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
- AuthenticationModuleElementCollection.cs
- SettingsPropertyCollection.cs
- _Connection.cs
- SQlBooleanStorage.cs
- TextElementEditingBehaviorAttribute.cs
- CompositeScriptReferenceEventArgs.cs
- HttpPostServerProtocol.cs
- FileDetails.cs
- InternalConfigSettingsFactory.cs
- DocumentsTrace.cs
- TextDecorationCollection.cs
- Variant.cs
- SmtpDigestAuthenticationModule.cs
- RestHandlerFactory.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- QuarticEase.cs
- UnsafeNativeMethods.cs
- ButtonColumn.cs
- Merger.cs
- TextTreeInsertUndoUnit.cs
- SchemaElementLookUpTableEnumerator.cs
- DataColumn.cs
- DCSafeHandle.cs
- DataControlImageButton.cs
- ListContractAdapter.cs
- HttpDigestClientCredential.cs
- DependencyObject.cs
- StreamResourceInfo.cs
- SqlProviderUtilities.cs
- MSG.cs
- HttpWriter.cs
- ConnectionPoint.cs
- FixedPageProcessor.cs
- WebPartEditVerb.cs
- SQLGuidStorage.cs
- Command.cs
- ServerIdentity.cs
- ColorConvertedBitmapExtension.cs
- ParserExtension.cs
- XPathSingletonIterator.cs
- XmlBufferReader.cs
- altserialization.cs
- AddingNewEventArgs.cs
- TableLayout.cs
- TextCollapsingProperties.cs
- errorpatternmatcher.cs
- CircleEase.cs
- LightweightEntityWrapper.cs
- BindingManagerDataErrorEventArgs.cs
- MultipartContentParser.cs
- WorkItem.cs
- MimeTypePropertyAttribute.cs
- LineVisual.cs
- XPathNavigatorKeyComparer.cs
- OutputCacheSettings.cs
- PeerCollaboration.cs
- SafeNativeMethods.cs
- KeyInstance.cs
- XmlSerializerImportOptions.cs
- TextProperties.cs
- BindingManagerDataErrorEventArgs.cs
- RootProfilePropertySettingsCollection.cs
- RequestCachePolicy.cs
- FlowDocumentFormatter.cs
- PrimitiveType.cs
- IdentitySection.cs
- BoundsDrawingContextWalker.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- SequentialOutput.cs
- WebCategoryAttribute.cs
- MetafileEditor.cs
- Html32TextWriter.cs
- WMIInterop.cs
- SafeLibraryHandle.cs
- DefaultValueConverter.cs
- Context.cs
- CurrentChangingEventManager.cs
- OracleException.cs
- RtfToken.cs
- CmsUtils.cs
- CompositeCollection.cs
- EvidenceTypeDescriptor.cs
- ByteViewer.cs
- ArgIterator.cs
- RepeaterItem.cs
- RangeValueProviderWrapper.cs
- EventSchemaTraceListener.cs
- HwndSource.cs
- HashRepartitionStream.cs
- SectionRecord.cs
- XmlDictionary.cs
- TTSEngineProxy.cs
- ClockController.cs
- PolyQuadraticBezierSegment.cs
- PeerDuplexChannelListener.cs
- DbSetClause.cs
- Point3DCollection.cs
- SqlDependencyListener.cs
- ReturnValue.cs
- HttpHandlersSection.cs