Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / Configuration / DynamicEndpointElement.cs / 1305376 / DynamicEndpointElement.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Discovery.Configuration { using System; using System.Configuration; using System.Diagnostics.CodeAnalysis; using System.Runtime; using System.ServiceModel.Channels; using System.ServiceModel.Configuration; using System.ServiceModel.Description; using System.Xml; [Fx.Tag.XamlVisible(false)] public sealed class DynamicEndpointElement : StandardEndpointElement { ConfigurationPropertyCollection properties; [ConfigurationProperty(ConfigurationStrings.DiscoveryClientSettings)] [SuppressMessage(FxCop.Category.Configuration, FxCop.Rule.ConfigurationValidatorAttributeRule, Justification = "No validator requiered.")] public DiscoveryClientSettingsElement DiscoveryClientSettings { get { return (DiscoveryClientSettingsElement)base[ConfigurationStrings.DiscoveryClientSettings]; } } protected internal override Type EndpointType { get { return typeof(DynamicEndpoint); } } protected override ConfigurationPropertyCollection Properties { get { if (this.properties == null) { ConfigurationPropertyCollection properties = base.Properties; properties.Add( new ConfigurationProperty( ConfigurationStrings.DiscoveryClientSettings, typeof(DiscoveryClientSettingsElement), null, null, null, ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; } } protected internal override ServiceEndpoint CreateServiceEndpoint(ContractDescription contractDescription) { return new DynamicEndpoint(contractDescription); } protected override void OnInitializeAndValidate(ChannelEndpointElement channelEndpointElement) { if (string.IsNullOrEmpty(channelEndpointElement.Contract)) { throw FxTrace.Exception.AsError( new ConfigurationErrorsException( SR.DiscoveryConfigContractNotSpecified(channelEndpointElement.Kind))); } if (channelEndpointElement.Address != null && !channelEndpointElement.Address.Equals(DiscoveryClientBindingElement.DiscoveryEndpointAddress.Uri)) { throw FxTrace.Exception.AsError( new ConfigurationErrorsException( SR.DiscoveryEndpointAddressIncorrect( "address", channelEndpointElement.Address, DiscoveryClientBindingElement.DiscoveryEndpointAddress.Uri))); } } protected override void OnInitializeAndValidate(ServiceEndpointElement serviceEndpointElement) { throw FxTrace.Exception.AsError( new InvalidOperationException( SR.DiscoveryConfigDynamicEndpointInService(serviceEndpointElement.Kind))); } protected override void OnApplyConfiguration(ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement) { } protected override void OnApplyConfiguration(ServiceEndpoint endpoint, ChannelEndpointElement serviceEndpointElement) { DynamicEndpoint dynamicEndpoint = (DynamicEndpoint)endpoint; if (!dynamicEndpoint.ValidateAndInsertDiscoveryClientBindingElement(dynamicEndpoint.Binding)) { throw FxTrace.Exception.AsError(new ConfigurationErrorsException(SR.DiscoveryClientBindingElementPresentInDynamicEndpoint)); } if (PropertyValueOrigin.Default == this.DiscoveryClientSettings.ElementInformation.Properties[ConfigurationStrings.Endpoint].ValueOrigin) { dynamicEndpoint.DiscoveryEndpointProvider = new ConfigurationDiscoveryEndpointProvider(); } else { dynamicEndpoint.DiscoveryEndpointProvider = new ConfigurationDiscoveryEndpointProvider(this.DiscoveryClientSettings.DiscoveryEndpoint); } this.DiscoveryClientSettings.FindCriteria.ApplyConfiguration(dynamicEndpoint.FindCriteria); if (dynamicEndpoint.FindCriteria.ContractTypeNames.Count == 0) { dynamicEndpoint.FindCriteria.ContractTypeNames.Add( new XmlQualifiedName(dynamicEndpoint.Contract.Name, dynamicEndpoint.Contract.Namespace)); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LineServices.cs
- WebWorkflowRole.cs
- httpserverutility.cs
- DataBindingHandlerAttribute.cs
- RegionData.cs
- LocalizedNameDescriptionPair.cs
- EntityDataSourceValidationException.cs
- Comparer.cs
- DropShadowEffect.cs
- CFGGrammar.cs
- AutomationAttributeInfo.cs
- SqlUserDefinedTypeAttribute.cs
- ECDsaCng.cs
- GatewayDefinition.cs
- SafeRightsManagementQueryHandle.cs
- StringKeyFrameCollection.cs
- RegistryPermission.cs
- SyndicationDeserializer.cs
- Camera.cs
- Brush.cs
- DateTimeOffset.cs
- ListBindableAttribute.cs
- ToolStripContentPanel.cs
- DesignerAttribute.cs
- FormattedTextSymbols.cs
- XmlCDATASection.cs
- GeneralTransform3DGroup.cs
- XPathDocumentIterator.cs
- Form.cs
- SplitterEvent.cs
- SHA1Managed.cs
- SqlRowUpdatedEvent.cs
- Label.cs
- TemplatedMailWebEventProvider.cs
- IteratorDescriptor.cs
- LineSegment.cs
- BufferAllocator.cs
- _KerberosClient.cs
- Fx.cs
- SamlAssertionKeyIdentifierClause.cs
- HWStack.cs
- WinEventWrap.cs
- AsyncPostBackTrigger.cs
- SelectionItemPatternIdentifiers.cs
- PolicyManager.cs
- WebEvents.cs
- Misc.cs
- DescendantBaseQuery.cs
- MetadataSet.cs
- ShapingWorkspace.cs
- LineServicesCallbacks.cs
- TransportContext.cs
- CodeCatchClauseCollection.cs
- FontNameEditor.cs
- StylusPointProperty.cs
- Tokenizer.cs
- _AutoWebProxyScriptHelper.cs
- WindowsStartMenu.cs
- ContextStack.cs
- GroupByQueryOperator.cs
- RootAction.cs
- PropertiesTab.cs
- NullableFloatSumAggregationOperator.cs
- WindowsAuthenticationModule.cs
- FusionWrap.cs
- Frame.cs
- SqlResolver.cs
- GenerateTemporaryAssemblyTask.cs
- ExtentJoinTreeNode.cs
- AnimatedTypeHelpers.cs
- CompoundFileIOPermission.cs
- XmlImplementation.cs
- TreeNodeCollection.cs
- DefaultMemberAttribute.cs
- NavigationProperty.cs
- FrameworkTemplate.cs
- MtomMessageEncodingElement.cs
- CdpEqualityComparer.cs
- TextTreeExtractElementUndoUnit.cs
- CheckedListBox.cs
- AnnotationHighlightLayer.cs
- XmlCharCheckingReader.cs
- DbProviderFactoriesConfigurationHandler.cs
- RepeatBehavior.cs
- unsafenativemethodsother.cs
- XmlDigitalSignatureProcessor.cs
- CertificateReferenceElement.cs
- EventLogHandle.cs
- SimpleHandlerFactory.cs
- ComplexLine.cs
- DynamicILGenerator.cs
- EntityStoreSchemaFilterEntry.cs
- ReliableRequestSessionChannel.cs
- OdbcConnectionPoolProviderInfo.cs
- File.cs
- _HeaderInfoTable.cs
- SettingsContext.cs
- TypeBuilder.cs
- ScrollChangedEventArgs.cs
- ExpressionUtilities.cs