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
- BitmapEffectGeneralTransform.cs
- CachedPathData.cs
- ConfigsHelper.cs
- DynamicScriptObject.cs
- String.cs
- _emptywebproxy.cs
- Container.cs
- KnownTypesProvider.cs
- SqlNotificationEventArgs.cs
- ColorContextHelper.cs
- WindowsListViewItemCheckBox.cs
- ChangePasswordDesigner.cs
- RuleSettingsCollection.cs
- ItemChangedEventArgs.cs
- PageStatePersister.cs
- KnownBoxes.cs
- BigIntegerStorage.cs
- Collection.cs
- AuthenticationManager.cs
- CfgParser.cs
- validationstate.cs
- ScriptingRoleServiceSection.cs
- StubHelpers.cs
- GreenMethods.cs
- Button.cs
- OperationValidationEventArgs.cs
- HighContrastHelper.cs
- LogLogRecord.cs
- TemplateControlBuildProvider.cs
- ManagedWndProcTracker.cs
- ServiceModelConfiguration.cs
- StringFunctions.cs
- DataGridViewRowHeaderCell.cs
- SetMemberBinder.cs
- LazyInitializer.cs
- TextElementCollectionHelper.cs
- AddInDeploymentState.cs
- SystemTcpStatistics.cs
- ButtonChrome.cs
- OraclePermissionAttribute.cs
- RewritingSimplifier.cs
- ISAPIApplicationHost.cs
- PropertyDescriptor.cs
- TimeSpanStorage.cs
- GridViewSelectEventArgs.cs
- IndentTextWriter.cs
- PolicyManager.cs
- SerializationInfoEnumerator.cs
- RelationshipEndCollection.cs
- ToolStripCodeDomSerializer.cs
- ConfigurationPropertyAttribute.cs
- Random.cs
- LinkTarget.cs
- Comparer.cs
- ExclusiveTcpListener.cs
- ClientProxyGenerator.cs
- NavigationEventArgs.cs
- SimpleHandlerFactory.cs
- OLEDB_Util.cs
- BlockCollection.cs
- HelpInfo.cs
- TrackingProfileManager.cs
- FragmentQueryProcessor.cs
- ServiceModelStringsVersion1.cs
- commandenforcer.cs
- CharConverter.cs
- RemoteWebConfigurationHostStream.cs
- LinearQuaternionKeyFrame.cs
- BlurBitmapEffect.cs
- SmiEventStream.cs
- TypeHelpers.cs
- PagerStyle.cs
- BamlBinaryWriter.cs
- UInt64Converter.cs
- ObjectItemCollection.cs
- RectConverter.cs
- SoapMessage.cs
- MobileControlPersister.cs
- BamlWriter.cs
- StandardBindingCollectionElement.cs
- ObjectViewListener.cs
- XmlSubtreeReader.cs
- RectangleGeometry.cs
- KeyGesture.cs
- FlowDocumentReader.cs
- RunClient.cs
- VariableQuery.cs
- PtsHost.cs
- Run.cs
- UpDownBaseDesigner.cs
- Soap12FormatExtensions.cs
- CompiledQuery.cs
- WsdlInspector.cs
- DataGridColumnHeadersPresenter.cs
- _CacheStreams.cs
- webclient.cs
- Content.cs
- TreeView.cs
- Relationship.cs
- ParseElement.cs