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
- TraceFilter.cs
- ColumnMapProcessor.cs
- DESCryptoServiceProvider.cs
- WebBrowserContainer.cs
- BasicBrowserDialog.cs
- Font.cs
- GridViewEditEventArgs.cs
- VariableExpressionConverter.cs
- SchemaCompiler.cs
- InvalidPrinterException.cs
- AuthorizationRuleCollection.cs
- ToolStripPanelRenderEventArgs.cs
- AssemblySettingAttributes.cs
- ProjectionPlan.cs
- PrimitiveType.cs
- DetailsViewCommandEventArgs.cs
- TreeNodeMouseHoverEvent.cs
- SelectionRangeConverter.cs
- MemberCollection.cs
- ConstantProjectedSlot.cs
- WebServiceTypeData.cs
- EntitySqlQueryState.cs
- ServiceHostingEnvironment.cs
- ExtensionSurface.cs
- RoutedCommand.cs
- QilVisitor.cs
- InArgument.cs
- StorageConditionPropertyMapping.cs
- Internal.cs
- GroupBox.cs
- IResourceProvider.cs
- Point.cs
- XsltInput.cs
- XPathSelfQuery.cs
- ZipIOLocalFileBlock.cs
- GridEntry.cs
- StandardTransformFactory.cs
- RootNamespaceAttribute.cs
- SeverityFilter.cs
- InfiniteTimeSpanConverter.cs
- State.cs
- IdentifierCollection.cs
- JsonFormatWriterGenerator.cs
- DiscreteKeyFrames.cs
- TcpHostedTransportConfiguration.cs
- WindowsClientElement.cs
- PermissionSetEnumerator.cs
- AssemblyHash.cs
- MimeTypeMapper.cs
- QilGenerator.cs
- XmlSchemaGroup.cs
- ExceptionUtility.cs
- TreeNodeMouseHoverEvent.cs
- WebSysDefaultValueAttribute.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- XpsS0ValidatingLoader.cs
- TrackingLocationCollection.cs
- MessageSecurityOverTcp.cs
- ExtensionFile.cs
- XamlStyleSerializer.cs
- UIElementCollection.cs
- ToolStripDropDownMenu.cs
- ChildrenQuery.cs
- ProcessHostConfigUtils.cs
- Block.cs
- SerialErrors.cs
- CodeRegionDirective.cs
- COM2PropertyDescriptor.cs
- DataKeyCollection.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ExtenderProviderService.cs
- StackSpiller.Temps.cs
- WorkflowQueue.cs
- TileModeValidation.cs
- ServiceMemoryGates.cs
- StringToken.cs
- GroupByExpressionRewriter.cs
- UserPreferenceChangingEventArgs.cs
- OperationContextScope.cs
- EdmProviderManifest.cs
- TypeReference.cs
- CompositeDataBoundControl.cs
- FontDifferentiator.cs
- TypeSystem.cs
- PngBitmapDecoder.cs
- _NTAuthentication.cs
- TabItemAutomationPeer.cs
- AsymmetricKeyExchangeDeformatter.cs
- TimelineCollection.cs
- OleDbConnectionInternal.cs
- TypeConverterAttribute.cs
- SequenceRange.cs
- FormsAuthenticationConfiguration.cs
- SurrogateSelector.cs
- ChangeProcessor.cs
- Misc.cs
- LinqToSqlWrapper.cs
- GradientSpreadMethodValidation.cs
- MappingModelBuildProvider.cs
- DataRowView.cs