Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- XmlHierarchyData.cs
- ExceptionTrace.cs
- DynamicValidatorEventArgs.cs
- SizeLimitedCache.cs
- CodeParameterDeclarationExpression.cs
- DataGridViewCellCollection.cs
- WindowsButton.cs
- EntityStoreSchemaGenerator.cs
- SchemaCollectionCompiler.cs
- mactripleDES.cs
- Nodes.cs
- TreeNodeClickEventArgs.cs
- CompiledAction.cs
- TypeSource.cs
- Propagator.ExtentPlaceholderCreator.cs
- GroupPartitionExpr.cs
- WebPartMenu.cs
- XmlSignatureProperties.cs
- DelegatingTypeDescriptionProvider.cs
- TableItemStyle.cs
- InputLanguageSource.cs
- CookieProtection.cs
- SuppressMessageAttribute.cs
- ButtonField.cs
- XmlReflectionImporter.cs
- AutomationElement.cs
- ClientTarget.cs
- DataListItem.cs
- MergeEnumerator.cs
- PackagePartCollection.cs
- MimeParameterWriter.cs
- QilInvokeEarlyBound.cs
- ReferencedType.cs
- HTMLTextWriter.cs
- SafeNativeMethods.cs
- ContextMenuStripGroup.cs
- SerializationStore.cs
- VirtualizingStackPanel.cs
- GuidelineSet.cs
- CmsInterop.cs
- documentsequencetextview.cs
- PersonalizationProviderCollection.cs
- TcpConnectionPool.cs
- StyleTypedPropertyAttribute.cs
- RegularExpressionValidator.cs
- MaskInputRejectedEventArgs.cs
- PnrpPeerResolverBindingElement.cs
- HyperLinkDataBindingHandler.cs
- SQLByteStorage.cs
- Metadata.cs
- ManagementEventWatcher.cs
- ApplyTemplatesAction.cs
- ToggleButton.cs
- SaveFileDialog.cs
- XmlSchemaSimpleTypeList.cs
- TextSelection.cs
- BamlBinaryReader.cs
- IsolatedStoragePermission.cs
- StructuralCache.cs
- TargetControlTypeCache.cs
- PermissionSet.cs
- MetadataArtifactLoaderResource.cs
- ObjectDataSourceView.cs
- ListViewEditEventArgs.cs
- ExpressionBinding.cs
- TlsnegoTokenProvider.cs
- ListViewAutomationPeer.cs
- TheQuery.cs
- ProxyAttribute.cs
- PropertyCondition.cs
- BaseValidator.cs
- IdentityNotMappedException.cs
- SplashScreen.cs
- XmlSignatureManifest.cs
- XamlStream.cs
- Int32KeyFrameCollection.cs
- XmlDownloadManager.cs
- DispatcherHooks.cs
- DataGridViewColumnStateChangedEventArgs.cs
- Nodes.cs
- fixedPageContentExtractor.cs
- Camera.cs
- TableLayoutColumnStyleCollection.cs
- HttpChannelHelpers.cs
- ByeMessageApril2005.cs
- DataGridViewLinkColumn.cs
- LocalFileSettingsProvider.cs
- TargetFrameworkUtil.cs
- EditorZone.cs
- ProvideValueServiceProvider.cs
- BitFlagsGenerator.cs
- IResourceProvider.cs
- Cursor.cs
- SQLGuid.cs
- MeshGeometry3D.cs
- OrderByLifter.cs
- GridLengthConverter.cs
- shaperfactory.cs
- WindowVisualStateTracker.cs
- DeflateStream.cs