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
- Nullable.cs
- ZipIOExtraField.cs
- ParenthesizePropertyNameAttribute.cs
- SqlResolver.cs
- ProxyAttribute.cs
- WSSecureConversation.cs
- ValueExpressions.cs
- HttpCookie.cs
- OleDbCommandBuilder.cs
- DispatcherEventArgs.cs
- TypeInitializationException.cs
- XmlIlTypeHelper.cs
- CodeMethodReturnStatement.cs
- AccessViolationException.cs
- ParameterElement.cs
- TraceSource.cs
- CommandHelper.cs
- Evidence.cs
- PassportAuthentication.cs
- PropertyAccessVisitor.cs
- CodeExpressionStatement.cs
- TextSyndicationContent.cs
- GridSplitter.cs
- LinqDataSourceView.cs
- ReadContentAsBinaryHelper.cs
- RangeValueProviderWrapper.cs
- RSACryptoServiceProvider.cs
- FlowLayoutPanel.cs
- Matrix.cs
- CollectionDataContract.cs
- SiteMapHierarchicalDataSourceView.cs
- BooleanAnimationBase.cs
- SocketStream.cs
- OutputWindow.cs
- UInt64.cs
- RemoteWebConfigurationHost.cs
- ParameterModifier.cs
- CompositionTarget.cs
- DesignerTransactionCloseEvent.cs
- AmbientLight.cs
- ConstrainedDataObject.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- FileUtil.cs
- Message.cs
- SqlBulkCopy.cs
- QueryContinueDragEvent.cs
- WindowsMenu.cs
- RealProxy.cs
- XsltLoader.cs
- MiniConstructorInfo.cs
- Quad.cs
- ColorAnimation.cs
- CapiNative.cs
- LicenseContext.cs
- DataGridViewButtonCell.cs
- FormatException.cs
- ToolStripArrowRenderEventArgs.cs
- DocumentViewerHelper.cs
- DbReferenceCollection.cs
- DockPattern.cs
- AffineTransform3D.cs
- CustomErrorsSection.cs
- SerialPort.cs
- XmlDataContract.cs
- AutoResizedEvent.cs
- ContentHostHelper.cs
- SafeEventLogWriteHandle.cs
- BooleanSwitch.cs
- NeutralResourcesLanguageAttribute.cs
- Button.cs
- _Events.cs
- Annotation.cs
- SiteMap.cs
- AnchorEditor.cs
- StorageAssociationSetMapping.cs
- ComplexBindingPropertiesAttribute.cs
- AuthenticationModuleElement.cs
- LabelLiteral.cs
- MultipartContentParser.cs
- CodeActivityContext.cs
- TranslateTransform3D.cs
- ConfigPathUtility.cs
- RegexWorker.cs
- CompoundFileIOPermission.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- ButtonBaseAdapter.cs
- CodeAttributeArgumentCollection.cs
- ValidationError.cs
- TableItemStyle.cs
- ObjectReferenceStack.cs
- Normalization.cs
- DesignerOptionService.cs
- WpfPayload.cs
- MarshalByRefObject.cs
- FixedTextSelectionProcessor.cs
- Pair.cs
- SelectionRange.cs
- BezierSegment.cs
- BindingList.cs
- HttpCookie.cs