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
- StringSource.cs
- InternalResources.cs
- CachedPathData.cs
- Stack.cs
- DefaultTextStore.cs
- ProcessModule.cs
- TextContainerHelper.cs
- ReachIDocumentPaginatorSerializer.cs
- Viewport3DAutomationPeer.cs
- Preprocessor.cs
- Marshal.cs
- LocalValueEnumerator.cs
- ListViewContainer.cs
- ScrollBar.cs
- HashHelper.cs
- GatewayIPAddressInformationCollection.cs
- TextServicesCompartmentContext.cs
- XomlSerializationHelpers.cs
- Transform3DCollection.cs
- QueryLifecycle.cs
- ListViewItem.cs
- DispatcherEventArgs.cs
- WsrmMessageInfo.cs
- SymLanguageType.cs
- XamlDesignerSerializationManager.cs
- DataViewSetting.cs
- log.cs
- Translator.cs
- CodeEntryPointMethod.cs
- LogEntryHeaderSerializer.cs
- wpf-etw.cs
- TabItem.cs
- SecurityPolicySection.cs
- Configuration.cs
- WindowVisualStateTracker.cs
- HideDisabledControlAdapter.cs
- RichTextBoxContextMenu.cs
- ToolBar.cs
- ToolStripProgressBar.cs
- WebPartTransformer.cs
- NativeCppClassAttribute.cs
- SwitchAttribute.cs
- GeneralTransform3DTo2D.cs
- CodeVariableReferenceExpression.cs
- TreeViewEvent.cs
- NGCSerializationManagerAsync.cs
- DataGridViewToolTip.cs
- ByteStreamGeometryContext.cs
- LinearGradientBrush.cs
- SafeNativeMethods.cs
- IndentedWriter.cs
- SrgsSemanticInterpretationTag.cs
- SetterTriggerConditionValueConverter.cs
- ImageMetadata.cs
- Context.cs
- DataService.cs
- assertwrapper.cs
- LocalFileSettingsProvider.cs
- SetUserPreferenceRequest.cs
- BufferModesCollection.cs
- IdentityModelDictionary.cs
- ClientSponsor.cs
- EventLogPermissionAttribute.cs
- EntityDescriptor.cs
- WebPartRestoreVerb.cs
- TableCellCollection.cs
- ChangePassword.cs
- EditableLabelControl.cs
- TrackPointCollection.cs
- SafeCertificateContext.cs
- ObjectHandle.cs
- WindowHelperService.cs
- InlineUIContainer.cs
- SchemaLookupTable.cs
- SvcMapFile.cs
- EventData.cs
- IgnoreFileBuildProvider.cs
- TimeSpan.cs
- BitmapEffectInputData.cs
- ApplicationProxyInternal.cs
- TickBar.cs
- TextContainerHelper.cs
- StatusStrip.cs
- RuntimeHandles.cs
- Stackframe.cs
- ParseElement.cs
- RenderData.cs
- DropSource.cs
- DrawingContext.cs
- CultureTableRecord.cs
- LabelDesigner.cs
- InternalResources.cs
- HandlerBase.cs
- FusionWrap.cs
- SerialErrors.cs
- RotateTransform3D.cs
- ChameleonKey.cs
- X509CertificateCollection.cs
- LocalServiceSecuritySettingsElement.cs
- MimeXmlImporter.cs