Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / Configuration / AnnouncementEndpointElement.cs / 1305376 / AnnouncementEndpointElement.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Discovery.Configuration { using System; using System.ComponentModel; using System.Configuration; using System.Diagnostics.CodeAnalysis; using System.Runtime; using System.ServiceModel.Configuration; using System.ServiceModel.Description; using SR2 = System.ServiceModel.Discovery.SR; public class AnnouncementEndpointElement : StandardEndpointElement { ConfigurationPropertyCollection properties; public AnnouncementEndpointElement() : base() { } [ConfigurationProperty(ConfigurationStrings.MaxAnnouncementDelay, DefaultValue = ConfigurationStrings.TimeSpanZero)] [TypeConverter(typeof(TimeSpanOrInfiniteConverter))] [ServiceModelTimeSpanValidator(MinValueString = ConfigurationStrings.TimeSpanZero)] public TimeSpan MaxAnnouncementDelay { get { return (TimeSpan)base[ConfigurationStrings.MaxAnnouncementDelay]; } set { base[ConfigurationStrings.MaxAnnouncementDelay] = value; } } [ConfigurationProperty(ConfigurationStrings.DiscoveryVersion, DefaultValue = ProtocolStrings.VersionNameDefault)] [TypeConverter(typeof(DiscoveryVersionConverter))] [SuppressMessage(FxCop.Category.Configuration, FxCop.Rule.ConfigurationValidatorAttributeRule)] public DiscoveryVersion DiscoveryVersion { get { return (DiscoveryVersion)base[ConfigurationStrings.DiscoveryVersion]; } set { base[ConfigurationStrings.DiscoveryVersion] = value; } } protected internal override Type EndpointType { get { return typeof(AnnouncementEndpoint); } } protected override ConfigurationPropertyCollection Properties { get { if (this.properties == null) { ConfigurationPropertyCollection properties = base.Properties; properties.Add( new ConfigurationProperty( ConfigurationStrings.MaxAnnouncementDelay, typeof(TimeSpan), TimeSpan.Zero, new TimeSpanOrInfiniteConverter(), new TimeSpanOrInfiniteValidator(TimeSpan.Zero, TimeSpan.MaxValue), ConfigurationPropertyOptions.None)); properties.Add( new ConfigurationProperty( ConfigurationStrings.DiscoveryVersion, typeof(DiscoveryVersion), DiscoveryVersion.DefaultDiscoveryVersion, new DiscoveryVersionConverter(), null, ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; } } protected internal override ServiceEndpoint CreateServiceEndpoint(ContractDescription contractDescription) { return new AnnouncementEndpoint(this.DiscoveryVersion); } protected internal override void InitializeFrom(ServiceEndpoint endpoint) { base.InitializeFrom(endpoint); AnnouncementEndpoint source = (AnnouncementEndpoint)endpoint; this.MaxAnnouncementDelay = source.MaxAnnouncementDelay; this.DiscoveryVersion = source.DiscoveryVersion; } protected override void OnInitializeAndValidate(ChannelEndpointElement channelEndpointElement) { if (!String.IsNullOrEmpty(channelEndpointElement.Contract)) { throw FxTrace.Exception.AsError(new ConfigurationErrorsException(SR2.DiscoveryConfigContractSpecified(channelEndpointElement.Kind))); } } protected override void OnInitializeAndValidate(ServiceEndpointElement serviceEndpointElement) { if (!String.IsNullOrEmpty(serviceEndpointElement.Contract)) { throw FxTrace.Exception.AsError(new ConfigurationErrorsException(SR2.DiscoveryConfigContractSpecified(serviceEndpointElement.Kind))); } } protected override void OnApplyConfiguration(ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement) { ApplyConfiguration(endpoint); } protected override void OnApplyConfiguration(ServiceEndpoint endpoint, ChannelEndpointElement serviceEndpointElement) { ApplyConfiguration(endpoint); } void ApplyConfiguration(ServiceEndpoint endpoint) { AnnouncementEndpoint announcementEndpoint = (AnnouncementEndpoint)endpoint; announcementEndpoint.MaxAnnouncementDelay = this.MaxAnnouncementDelay; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SignedInfo.cs
- PrintDocument.cs
- DelayedRegex.cs
- CodeIdentifiers.cs
- RangeValuePattern.cs
- BulletedList.cs
- DesignerActionItem.cs
- KeyValueConfigurationCollection.cs
- CharAnimationBase.cs
- PopupRootAutomationPeer.cs
- DbException.cs
- ReferencedAssemblyResolver.cs
- AnnotationObservableCollection.cs
- FrameworkTextComposition.cs
- XPathDocumentIterator.cs
- ListDependantCardsRequest.cs
- SqlResolver.cs
- UnaryOperationBinder.cs
- InstanceNameConverter.cs
- TextRangeAdaptor.cs
- DataGridViewDataErrorEventArgs.cs
- GenerateTemporaryAssemblyTask.cs
- AnonymousIdentificationSection.cs
- WindowsGraphicsWrapper.cs
- Normalizer.cs
- BooleanSwitch.cs
- EntityProviderServices.cs
- EntityParameterCollection.cs
- FontStyleConverter.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- HostingEnvironment.cs
- QueueProcessor.cs
- CompositeScriptReference.cs
- SqlUtils.cs
- RecordsAffectedEventArgs.cs
- SmtpDigestAuthenticationModule.cs
- Code.cs
- RoutingConfiguration.cs
- Point4DValueSerializer.cs
- XPathScanner.cs
- WebPartsPersonalization.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- _SpnDictionary.cs
- SizeF.cs
- ReliableChannelFactory.cs
- Material.cs
- DisplayClaim.cs
- OutputCacheProfileCollection.cs
- ZipIOBlockManager.cs
- GroupByQueryOperator.cs
- UnsafeNativeMethods.cs
- ToolStripLocationCancelEventArgs.cs
- PasswordRecovery.cs
- CapacityStreamGeometryContext.cs
- SqlDataSourceCache.cs
- PreviewKeyDownEventArgs.cs
- ICspAsymmetricAlgorithm.cs
- HttpModulesSection.cs
- ProjectedSlot.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- CodeTypeMember.cs
- SolidColorBrush.cs
- GradientStop.cs
- PixelShader.cs
- RecognizerStateChangedEventArgs.cs
- BitmapData.cs
- SmiEventSink_Default.cs
- DllNotFoundException.cs
- _IPv6Address.cs
- BitmapEffectGeneralTransform.cs
- ComponentDesigner.cs
- EventLog.cs
- tibetanshape.cs
- ExpanderAutomationPeer.cs
- JsonClassDataContract.cs
- EncoderReplacementFallback.cs
- EmulateRecognizeCompletedEventArgs.cs
- AQNBuilder.cs
- UriSectionReader.cs
- WindowsSpinner.cs
- PointConverter.cs
- SourceLineInfo.cs
- AttributeSetAction.cs
- OperationAbortedException.cs
- UnsafeNetInfoNativeMethods.cs
- COSERVERINFO.cs
- FilteredDataSetHelper.cs
- MultiAsyncResult.cs
- LinqDataSourceUpdateEventArgs.cs
- TimeStampChecker.cs
- AndMessageFilterTable.cs
- Pts.cs
- HandlerBase.cs
- UnsafeNativeMethodsCLR.cs
- Completion.cs
- Point3DConverter.cs
- DataKey.cs
- PropertyMap.cs
- ExtensionQuery.cs
- UTF7Encoding.cs