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
- SetStoryboardSpeedRatio.cs
- DataKeyArray.cs
- URL.cs
- ExpressionEditor.cs
- RoamingStoreFileUtility.cs
- NumberFormatInfo.cs
- XMLDiffLoader.cs
- ElementUtil.cs
- DropSource.cs
- SaveFileDialog.cs
- Image.cs
- LogLogRecordHeader.cs
- IteratorFilter.cs
- CalendarDay.cs
- QueryFunctions.cs
- GPRECTF.cs
- CachedPathData.cs
- InkCanvasSelectionAdorner.cs
- BigInt.cs
- DesignerCatalogPartChrome.cs
- TableNameAttribute.cs
- LinkTarget.cs
- Inline.cs
- LayoutTableCell.cs
- ThreadStartException.cs
- UInt16.cs
- IDispatchConstantAttribute.cs
- DBDataPermissionAttribute.cs
- TableCell.cs
- TreeViewCancelEvent.cs
- Thread.cs
- Cloud.cs
- TTSEngineTypes.cs
- ComponentDispatcherThread.cs
- MSG.cs
- RelationshipEndMember.cs
- LoginName.cs
- XmlConverter.cs
- DirectoryRedirect.cs
- DataGridColumnCollection.cs
- PropertyRecord.cs
- UnsafeNativeMethods.cs
- FileUtil.cs
- UidManager.cs
- SQLDoubleStorage.cs
- TileBrush.cs
- CharacterShapingProperties.cs
- TextModifierScope.cs
- OleDbEnumerator.cs
- ResumeStoryboard.cs
- RC2CryptoServiceProvider.cs
- ContentPosition.cs
- BitmapEffectInputData.cs
- ServiceTimeoutsBehavior.cs
- PersistenceTypeAttribute.cs
- DataGridViewToolTip.cs
- Pen.cs
- ModelVisual3D.cs
- WasHostedComPlusFactory.cs
- SuppressIldasmAttribute.cs
- GeometryCollection.cs
- TitleStyle.cs
- shaperfactoryquerycachekey.cs
- ChtmlSelectionListAdapter.cs
- PersistChildrenAttribute.cs
- PerformanceCounterPermission.cs
- COM2FontConverter.cs
- TrackingQuery.cs
- GenericEnumerator.cs
- PathTooLongException.cs
- GAC.cs
- WindowsAuthenticationEventArgs.cs
- SpecialFolderEnumConverter.cs
- SymmetricCryptoHandle.cs
- ViewStateException.cs
- DirectionalLight.cs
- UnmanagedHandle.cs
- Int32Converter.cs
- JavaScriptSerializer.cs
- OrderingExpression.cs
- Clipboard.cs
- SymbolMethod.cs
- DataListItem.cs
- EnumType.cs
- TreeWalkHelper.cs
- HtmlImage.cs
- FontStyle.cs
- followingsibling.cs
- RectIndependentAnimationStorage.cs
- MorphHelper.cs
- MemoryStream.cs
- IndexedEnumerable.cs
- HideDisabledControlAdapter.cs
- EmptyTextWriter.cs
- RightsManagementInformation.cs
- Converter.cs
- TopClause.cs
- StylusLogic.cs
- CommentEmitter.cs
- SqlDataSourceSelectingEventArgs.cs