Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / StandardBindingCollectionElement.cs / 1 / StandardBindingCollectionElement.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System.Collections.Generic; using System.Collections.ObjectModel; using System.Configuration; using System.ServiceModel; using System.ServiceModel.Channels; public partial class StandardBindingCollectionElement: BindingCollectionElement where TStandardBinding : Binding where TBindingConfiguration : StandardBindingElement, new () { [ConfigurationProperty(ConfigurationStrings.DefaultCollectionName, Options = ConfigurationPropertyOptions.IsDefaultCollection)] public StandardBindingElementCollection Bindings { get {return (StandardBindingElementCollection ) base[ConfigurationStrings.DefaultCollectionName]; } } public override Type BindingType { get { return typeof(TStandardBinding); } } public override ReadOnlyCollection ConfiguredBindings { get { List configuredBindings = new List (); foreach (IBindingConfigurationElement configuredBinding in this.Bindings) { configuredBindings.Add(configuredBinding); } return new ReadOnlyCollection (configuredBindings); } } public override bool ContainsKey(string name) { // This line needed because of the IBindingSection implementation StandardBindingCollectionElement me = (StandardBindingCollectionElement ) this; #pragma warning suppress 56506 //[....]; me.Bindings can never be null (underlying configuration system guarantees) return me.Bindings.ContainsKey(name); } protected internal override Binding GetDefault() { return System.Activator.CreateInstance (); } protected internal override bool TryAdd(string name, Binding binding, Configuration config) { // The configuration item needs to understand the BindingType && be of type CustomBindingConfigurationElement // or StandardBindingConfigurationElement bool retval = (binding.GetType() == typeof(TStandardBinding)) && typeof(StandardBindingElement).IsAssignableFrom(typeof(TBindingConfiguration)); if (retval) { TBindingConfiguration bindingConfig = new TBindingConfiguration(); bindingConfig.Name = name; bindingConfig.InitializeFrom(binding); this.Bindings.Add(bindingConfig); } return retval; } } } // 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
- Stack.cs
- BmpBitmapEncoder.cs
- ProfileGroupSettingsCollection.cs
- CleanUpVirtualizedItemEventArgs.cs
- DoubleCollectionConverter.cs
- DeploymentSection.cs
- LocalBuilder.cs
- RegexTree.cs
- AtomContentProperty.cs
- TableDetailsRow.cs
- BinaryKeyIdentifierClause.cs
- ReflectionPermission.cs
- KnownColorTable.cs
- EpmSourcePathSegment.cs
- ProxyWebPartManager.cs
- Popup.cs
- CapiNative.cs
- WebEventTraceProvider.cs
- EventsTab.cs
- AsyncCompletedEventArgs.cs
- DbMetaDataCollectionNames.cs
- BitFlagsGenerator.cs
- RoutedPropertyChangedEventArgs.cs
- UrlSyndicationContent.cs
- PeerObject.cs
- IncomingWebRequestContext.cs
- FileSystemWatcher.cs
- MenuCommands.cs
- Codec.cs
- KnownBoxes.cs
- PrintingPermission.cs
- SQLGuid.cs
- _HelperAsyncResults.cs
- StylusDevice.cs
- ClientRuntimeConfig.cs
- FixedFlowMap.cs
- SemanticKeyElement.cs
- ObjectTypeMapping.cs
- ApplicationSecurityInfo.cs
- XmlWriterTraceListener.cs
- DecoratedNameAttribute.cs
- WhitespaceSignificantCollectionAttribute.cs
- SemaphoreFullException.cs
- DataGridViewRowCollection.cs
- RowUpdatingEventArgs.cs
- UserMapPath.cs
- Enumerable.cs
- EpmContentDeSerializer.cs
- GregorianCalendar.cs
- PeerContact.cs
- TimelineGroup.cs
- TextEmbeddedObject.cs
- MenuEventArgs.cs
- RemoveFromCollection.cs
- InternalConfigConfigurationFactory.cs
- Propagator.Evaluator.cs
- SqlUserDefinedAggregateAttribute.cs
- AdapterDictionary.cs
- HashMembershipCondition.cs
- TemplatePropertyEntry.cs
- X509DefaultServiceCertificateElement.cs
- EtwTrace.cs
- TdsParserStaticMethods.cs
- RuntimeEnvironment.cs
- TypeSemantics.cs
- PerformanceCounterLib.cs
- TypeReference.cs
- _UriTypeConverter.cs
- ConsumerConnectionPointCollection.cs
- ViewStateModeByIdAttribute.cs
- clipboard.cs
- SingleBodyParameterMessageFormatter.cs
- TimeIntervalCollection.cs
- RemotingServices.cs
- EpmCustomContentSerializer.cs
- XmlText.cs
- DecoderReplacementFallback.cs
- DesignerSerializationVisibilityAttribute.cs
- ActivityTrace.cs
- CultureTable.cs
- DataGridViewButtonCell.cs
- ADMembershipUser.cs
- XamlRtfConverter.cs
- BitFlagsGenerator.cs
- util.cs
- ObjectDataProvider.cs
- PageSettings.cs
- DBConcurrencyException.cs
- ViewGenerator.cs
- XamlTemplateSerializer.cs
- PointHitTestParameters.cs
- Icon.cs
- EdmScalarPropertyAttribute.cs
- CollectionEditorDialog.cs
- WebServiceErrorEvent.cs
- PrintController.cs
- FontSizeConverter.cs
- XsltArgumentList.cs
- mactripleDES.cs
- AnnotationResourceCollection.cs