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
- ApplicationCommands.cs
- ConfigXmlText.cs
- ConditionCollection.cs
- ServiceReference.cs
- DataServiceConfiguration.cs
- TokenFactoryBase.cs
- ChooseAction.cs
- RuleCache.cs
- Int32Converter.cs
- CodeAttributeArgument.cs
- HtmlInputFile.cs
- ISAPIWorkerRequest.cs
- AnonymousIdentificationModule.cs
- ProcessInputEventArgs.cs
- GeneratedCodeAttribute.cs
- SQLSingleStorage.cs
- PeerName.cs
- CommandHelper.cs
- UpDownBase.cs
- MachineKeySection.cs
- ConnectionConsumerAttribute.cs
- SystemKeyConverter.cs
- Error.cs
- NetPipeSectionData.cs
- ToolBarButton.cs
- CompatibleIComparer.cs
- Completion.cs
- SqlDataSourceCommandParser.cs
- MarkupWriter.cs
- WebFormsRootDesigner.cs
- UpdatePanelTriggerCollection.cs
- BinaryWriter.cs
- AttachmentCollection.cs
- Fonts.cs
- EmptyQuery.cs
- CanonicalFontFamilyReference.cs
- Publisher.cs
- StorageAssociationSetMapping.cs
- EntityDesignPluralizationHandler.cs
- TraceLog.cs
- _SafeNetHandles.cs
- XmlEntityReference.cs
- DatePickerTextBox.cs
- Geometry.cs
- InvalidPrinterException.cs
- XmlResolver.cs
- SmiConnection.cs
- CultureSpecificCharacterBufferRange.cs
- AuthenticationSchemesHelper.cs
- CommandEventArgs.cs
- FaultReason.cs
- ConsoleKeyInfo.cs
- MetadataUtilsSmi.cs
- LinqDataSourceHelper.cs
- CodeNamespaceImportCollection.cs
- PropertiesTab.cs
- KeyInfo.cs
- Parameter.cs
- ObjectListTitleAttribute.cs
- StaticExtension.cs
- ToolBarButtonClickEvent.cs
- SByte.cs
- SimpleBitVector32.cs
- CursorConverter.cs
- DrawItemEvent.cs
- DataProtection.cs
- EntitySqlQueryCacheKey.cs
- WebPartActionVerb.cs
- ListCollectionView.cs
- TextView.cs
- UpdatePanelTriggerCollection.cs
- _UriTypeConverter.cs
- IndexedString.cs
- Font.cs
- Attachment.cs
- StorageFunctionMapping.cs
- DrawItemEvent.cs
- NumberSubstitution.cs
- CellIdBoolean.cs
- CodeBlockBuilder.cs
- UpdateTranslator.cs
- TextBlock.cs
- bidPrivateBase.cs
- SchemaNames.cs
- RemotingConfiguration.cs
- DbProviderFactoriesConfigurationHandler.cs
- XsltCompileContext.cs
- Panel.cs
- SQLDecimal.cs
- SafeCryptoKeyHandle.cs
- CallbackHandler.cs
- PointCollectionConverter.cs
- ErrorReporting.cs
- ToolStripMenuItem.cs
- UnicodeEncoding.cs
- CodeBlockBuilder.cs
- MatchAllMessageFilter.cs
- PenThreadPool.cs
- Interfaces.cs
- ConnectionPoint.cs