Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / ServiceModelTimeSpanValidator.cs / 1 / ServiceModelTimeSpanValidator.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System; using System.Configuration; using System.Globalization; using System.ComponentModel; // deals with [AttributeUsage(AttributeTargets.Property)] sealed class ServiceModelTimeSpanValidatorAttribute : ConfigurationValidatorAttribute { TimeSpanValidatorAttribute innerValidatorAttribute; public ServiceModelTimeSpanValidatorAttribute() { this.innerValidatorAttribute = new TimeSpanValidatorAttribute(); this.innerValidatorAttribute.MaxValueString = TimeoutHelper.MaxWait.ToString(); } public override ConfigurationValidatorBase ValidatorInstance { get { return new TimeSpanOrInfiniteValidator(MinValue, MaxValue); } } public TimeSpan MinValue { get { return this.innerValidatorAttribute.MinValue; } } public string MinValueString { get { return this.innerValidatorAttribute.MinValueString; } set { this.innerValidatorAttribute.MinValueString = value; } } public TimeSpan MaxValue { get { return this.innerValidatorAttribute.MaxValue; } } public string MaxValueString { get { return this.innerValidatorAttribute.MaxValueString; } set { this.innerValidatorAttribute.MaxValueString = value; } } } class TimeSpanOrInfiniteValidator : TimeSpanValidator { public TimeSpanOrInfiniteValidator(TimeSpan minValue, TimeSpan maxValue) : base(minValue, maxValue) { } public override void Validate(object value) { if (value.GetType() == typeof(TimeSpan) && (TimeSpan)value == TimeSpan.MaxValue) { return; // we're good } base.Validate(value); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ManipulationDelta.cs
- HtmlButton.cs
- CompilerInfo.cs
- hresults.cs
- SmtpNegotiateAuthenticationModule.cs
- SafeSecurityHandles.cs
- ListItemsCollectionEditor.cs
- DataGridColumn.cs
- UnicastIPAddressInformationCollection.cs
- SessionStateContainer.cs
- TcpHostedTransportConfiguration.cs
- shaperfactoryquerycacheentry.cs
- VisualCollection.cs
- ResourceCategoryAttribute.cs
- IDReferencePropertyAttribute.cs
- TextParaLineResult.cs
- BitmapMetadataEnumerator.cs
- QilParameter.cs
- CodeAttributeArgument.cs
- AutomationPropertyInfo.cs
- KeyedHashAlgorithm.cs
- HMACSHA384.cs
- CounterCreationData.cs
- StatusBar.cs
- XmlBindingWorker.cs
- PerfService.cs
- ExpressionBuilder.cs
- CacheChildrenQuery.cs
- XmlNodeReader.cs
- RequestCache.cs
- IOException.cs
- ProtocolsConfigurationHandler.cs
- ValueOfAction.cs
- ConnectionsZone.cs
- StrokeFIndices.cs
- AddInSegmentDirectoryNotFoundException.cs
- PropertyGrid.cs
- BlurEffect.cs
- ToolStripPanel.cs
- ProfileBuildProvider.cs
- Brush.cs
- TracingConnectionListener.cs
- ReceiveActivityDesigner.cs
- DetailsViewRow.cs
- StrokeFIndices.cs
- WsrmMessageInfo.cs
- SharedPerformanceCounter.cs
- ComProxy.cs
- ToolConsole.cs
- SystemIcmpV4Statistics.cs
- WpfXamlLoader.cs
- FileRecordSequence.cs
- PermissionToken.cs
- BinaryWriter.cs
- NetSectionGroup.cs
- ViewEventArgs.cs
- HostnameComparisonMode.cs
- ListViewGroup.cs
- Stopwatch.cs
- KnowledgeBase.cs
- sqlstateclientmanager.cs
- ToolStripSplitStackLayout.cs
- SqlUserDefinedTypeAttribute.cs
- RuntimeWrappedException.cs
- Suspend.cs
- QueryProcessor.cs
- SizeAnimationClockResource.cs
- Pen.cs
- XmlChoiceIdentifierAttribute.cs
- URLString.cs
- _LocalDataStore.cs
- OletxResourceManager.cs
- CachedPathData.cs
- XPathArrayIterator.cs
- AutomationElementCollection.cs
- DelegateTypeInfo.cs
- UIElement3D.cs
- LinkUtilities.cs
- ArrayElementGridEntry.cs
- GlyphInfoList.cs
- ProxyFragment.cs
- StringSource.cs
- BrowsableAttribute.cs
- DataQuery.cs
- ApplyHostConfigurationBehavior.cs
- XmlDataSourceView.cs
- TextTreeTextNode.cs
- SoapElementAttribute.cs
- ClusterUtils.cs
- WindowHideOrCloseTracker.cs
- DataContractSerializer.cs
- Int32Animation.cs
- AppDomain.cs
- InstanceKey.cs
- lengthconverter.cs
- StatusBarItem.cs
- DatagridviewDisplayedBandsData.cs
- TextSerializer.cs
- SerializationEventsCache.cs
- DataPagerFieldItem.cs