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
- MessageBox.cs
- GACMembershipCondition.cs
- DateTimeOffset.cs
- SignalGate.cs
- InstanceData.cs
- EmbeddedMailObjectsCollection.cs
- SuspendDesigner.cs
- ButtonBaseAutomationPeer.cs
- SoapCommonClasses.cs
- AppSettings.cs
- HotSpot.cs
- WebHttpEndpointElement.cs
- SafeFindHandle.cs
- SingleResultAttribute.cs
- RadioButtonRenderer.cs
- PkcsUtils.cs
- StorageScalarPropertyMapping.cs
- AuthenticatedStream.cs
- serverconfig.cs
- SqlDataSourceStatusEventArgs.cs
- DataGridViewComboBoxEditingControl.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- COAUTHIDENTITY.cs
- XmlArrayItemAttribute.cs
- _DigestClient.cs
- XmlElementCollection.cs
- ParagraphVisual.cs
- _SslState.cs
- EncodingTable.cs
- DbModificationClause.cs
- OdbcError.cs
- __Filters.cs
- PermissionSetEnumerator.cs
- CodeNamespace.cs
- TextDecorationLocationValidation.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- TrackingProfileDeserializationException.cs
- XmlWriterTraceListener.cs
- NotifyCollectionChangedEventArgs.cs
- SchemaComplexType.cs
- ExtentJoinTreeNode.cs
- GridItemCollection.cs
- AxisAngleRotation3D.cs
- CreateUserWizardAutoFormat.cs
- AssociationTypeEmitter.cs
- HMACSHA1.cs
- FamilyTypefaceCollection.cs
- CheckBoxField.cs
- FormViewModeEventArgs.cs
- ChangeBlockUndoRecord.cs
- WebPartCloseVerb.cs
- MaskedTextProvider.cs
- SqlVersion.cs
- SvcFileManager.cs
- XmlNodeList.cs
- DropDownButton.cs
- BasicKeyConstraint.cs
- ProtocolsConfiguration.cs
- TrustLevel.cs
- FunctionUpdateCommand.cs
- Filter.cs
- ApplicationServicesHostFactory.cs
- ObjectDataSourceStatusEventArgs.cs
- XmlILIndex.cs
- ScriptingScriptResourceHandlerSection.cs
- WorkflowMarkupSerializationProvider.cs
- MemoryMappedViewAccessor.cs
- PtsPage.cs
- SqlXmlStorage.cs
- MarshalByRefObject.cs
- WpfXamlType.cs
- LinqDataSourceSelectEventArgs.cs
- TypeConverter.cs
- ServicePointManagerElement.cs
- CreateWorkflowOwnerCommand.cs
- WebPartDeleteVerb.cs
- XmlCustomFormatter.cs
- XamlPointCollectionSerializer.cs
- CompositeControl.cs
- AppPool.cs
- RequestSecurityTokenSerializer.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- CodeTypeReferenceExpression.cs
- GenericUriParser.cs
- CommandHelper.cs
- linebase.cs
- ObjectDisposedException.cs
- filewebrequest.cs
- ContentHostHelper.cs
- RuleRef.cs
- SourceFilter.cs
- Attributes.cs
- SelectedDatesCollection.cs
- WebServiceMethodData.cs
- RemotingHelper.cs
- FormsIdentity.cs
- EnumType.cs
- PlatformCulture.cs
- SharingService.cs
- Exceptions.cs