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
- UrlMappingsModule.cs
- PropertyRef.cs
- SimpleExpression.cs
- ControllableStoryboardAction.cs
- RichTextBox.cs
- DesignTableCollection.cs
- HyperLinkDesigner.cs
- KeyedQueue.cs
- MemberJoinTreeNode.cs
- CompressEmulationStream.cs
- LineBreak.cs
- ToolStripDropDownMenu.cs
- glyphs.cs
- ListenerElementsCollection.cs
- EntitySqlQueryCacheKey.cs
- AvTraceFormat.cs
- ComponentConverter.cs
- _UriTypeConverter.cs
- SurrogateDataContract.cs
- ReadWriteControlDesigner.cs
- ReferentialConstraint.cs
- UTF32Encoding.cs
- NativeCppClassAttribute.cs
- SizeAnimationBase.cs
- ErrorTableItemStyle.cs
- SimpleApplicationHost.cs
- DecimalKeyFrameCollection.cs
- Drawing.cs
- Style.cs
- dataobject.cs
- SafeNativeMethodsCLR.cs
- DesignerActionGlyph.cs
- MailWebEventProvider.cs
- ArrayConverter.cs
- XmlSchemaElement.cs
- ElementNotEnabledException.cs
- DCSafeHandle.cs
- Light.cs
- JavascriptCallbackResponseProperty.cs
- DecoderExceptionFallback.cs
- ObjectViewEntityCollectionData.cs
- IncrementalHitTester.cs
- GetResponse.cs
- OrderingInfo.cs
- RectangleConverter.cs
- CustomAttribute.cs
- BorderSidesEditor.cs
- DnsPermission.cs
- ReadOnlyNameValueCollection.cs
- DelegatingMessage.cs
- ConnectionPoint.cs
- EntityDataSourceContextCreatedEventArgs.cs
- PageTheme.cs
- PixelShader.cs
- X509ChainElement.cs
- LinqDataSourceUpdateEventArgs.cs
- Size.cs
- WindowsStatic.cs
- TitleStyle.cs
- DynamicILGenerator.cs
- FileDialog_Vista.cs
- LinkLabelLinkClickedEvent.cs
- WebPartCollection.cs
- SqlBulkCopyColumnMapping.cs
- HMACSHA1.cs
- XmlUnspecifiedAttribute.cs
- DLinqAssociationProvider.cs
- StrongNamePublicKeyBlob.cs
- RegexInterpreter.cs
- UnsafeNativeMethods.cs
- DebugHandleTracker.cs
- CodeExpressionStatement.cs
- ClassDataContract.cs
- WindowsListViewSubItem.cs
- XMLSchema.cs
- XmlNamespaceMappingCollection.cs
- DocumentSequenceHighlightLayer.cs
- DynamicMethod.cs
- MetadataSerializer.cs
- SwitchAttribute.cs
- GatewayDefinition.cs
- DataBinder.cs
- WebBaseEventKeyComparer.cs
- TextAction.cs
- StateChangeEvent.cs
- EraserBehavior.cs
- PropertyIDSet.cs
- ProcessHostFactoryHelper.cs
- ActivityCodeGenerator.cs
- IDReferencePropertyAttribute.cs
- namescope.cs
- VoiceSynthesis.cs
- ServiceSecurityAuditBehavior.cs
- ResourceProviderFactory.cs
- EntityDataSourceChangingEventArgs.cs
- EntitySqlQueryState.cs
- FileDetails.cs
- ToolStripItemRenderEventArgs.cs
- Socket.cs
- HandlerBase.cs