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
- BinaryMethodMessage.cs
- WebColorConverter.cs
- SequentialWorkflowHeaderFooter.cs
- StrongBox.cs
- EncodingInfo.cs
- RelatedImageListAttribute.cs
- SiteOfOriginPart.cs
- StrokeNodeEnumerator.cs
- PolyQuadraticBezierSegment.cs
- Codec.cs
- SchemaObjectWriter.cs
- MatrixStack.cs
- MimeParameterWriter.cs
- CodeArgumentReferenceExpression.cs
- UriExt.cs
- SafeMarshalContext.cs
- ObjectAnimationUsingKeyFrames.cs
- ExpressionNode.cs
- IdentifierService.cs
- DescendantBaseQuery.cs
- DefaultTraceListener.cs
- ListView.cs
- LogSwitch.cs
- ObjectReaderCompiler.cs
- RenderData.cs
- PathHelper.cs
- odbcmetadatacollectionnames.cs
- TableSectionStyle.cs
- OleDbReferenceCollection.cs
- CleanUpVirtualizedItemEventArgs.cs
- HttpListenerElement.cs
- CorrelationValidator.cs
- TextStore.cs
- WebUtil.cs
- SmiRecordBuffer.cs
- WebPartConnectionsConfigureVerb.cs
- ItemType.cs
- _NetRes.cs
- EndpointAddressMessageFilter.cs
- ExpressionEditorAttribute.cs
- MobileCapabilities.cs
- BrowserTree.cs
- FrameworkRichTextComposition.cs
- NullableConverter.cs
- odbcmetadatacollectionnames.cs
- CircleHotSpot.cs
- Enum.cs
- MetadataException.cs
- QuaternionValueSerializer.cs
- ListItemConverter.cs
- SchemaImporterExtensionsSection.cs
- AvTraceDetails.cs
- SessionStateSection.cs
- FormClosedEvent.cs
- PackageStore.cs
- AnalyzedTree.cs
- Matrix3D.cs
- PlatformCulture.cs
- BamlTreeMap.cs
- ContentElement.cs
- _AutoWebProxyScriptWrapper.cs
- UIAgentAsyncParams.cs
- TextDecorationLocationValidation.cs
- MethodAccessException.cs
- HijriCalendar.cs
- UdpConstants.cs
- XmlReaderDelegator.cs
- XmlCodeExporter.cs
- UserControlParser.cs
- TemplateComponentConnector.cs
- X509Extension.cs
- ConfigurationSectionHelper.cs
- Comparer.cs
- DesignerProperties.cs
- DataControlPagerLinkButton.cs
- DiscoveryMessageSequence.cs
- COAUTHINFO.cs
- SQLRoleProvider.cs
- VisualProxy.cs
- AsyncOperation.cs
- MD5.cs
- OperationInfo.cs
- NameValueFileSectionHandler.cs
- OracleNumber.cs
- WebWorkflowRole.cs
- RootDesignerSerializerAttribute.cs
- BackgroundFormatInfo.cs
- TableDetailsRow.cs
- UncommonField.cs
- DbDeleteCommandTree.cs
- EntityModelSchemaGenerator.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- StorageModelBuildProvider.cs
- TemplateBindingExtension.cs
- ConfigurationException.cs
- PropertyRef.cs
- PointLight.cs
- ProcessModelSection.cs
- _NegoStream.cs
- PrtTicket_Public_Simple.cs