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
- EntityDataSourceDesignerHelper.cs
- IteratorAsyncResult.cs
- PackWebRequest.cs
- DataListItemCollection.cs
- DataSourceNameHandler.cs
- BamlReader.cs
- XmlQueryContext.cs
- QueryMath.cs
- CustomTypeDescriptor.cs
- ErrorFormatterPage.cs
- SpeechRecognizer.cs
- DrawingAttributeSerializer.cs
- Parser.cs
- DataGridItemEventArgs.cs
- HttpDebugHandler.cs
- UnmanagedMemoryStream.cs
- __FastResourceComparer.cs
- ListViewItemSelectionChangedEvent.cs
- VScrollBar.cs
- PostBackTrigger.cs
- PagesChangedEventArgs.cs
- ModelPropertyImpl.cs
- TableLayoutSettings.cs
- HWStack.cs
- TreeNodeStyle.cs
- XPathException.cs
- ContextActivityUtils.cs
- DataServiceSaveChangesEventArgs.cs
- DynamicArgumentDialog.cs
- FilteredDataSetHelper.cs
- ScrollViewerAutomationPeer.cs
- AttributeUsageAttribute.cs
- AuthenticationModuleElement.cs
- Vars.cs
- PropertyDescriptorGridEntry.cs
- StorageComplexPropertyMapping.cs
- WebControlsSection.cs
- ContextMenuService.cs
- EncoderParameters.cs
- ContentPlaceHolderDesigner.cs
- RenderData.cs
- ScriptDescriptor.cs
- OpenTypeLayoutCache.cs
- ObjectManager.cs
- Match.cs
- Buffer.cs
- BaseDataList.cs
- ScriptDescriptor.cs
- WebBrowserContainer.cs
- AnnotationAdorner.cs
- SiteOfOriginPart.cs
- DetailsViewInsertEventArgs.cs
- Property.cs
- GridViewUpdatedEventArgs.cs
- ClientSettingsProvider.cs
- AlternateViewCollection.cs
- RemoteWebConfigurationHost.cs
- ProxyWebPart.cs
- StaticExtension.cs
- CodeDomDecompiler.cs
- ElementAction.cs
- Selection.cs
- Compiler.cs
- ListViewHitTestInfo.cs
- TemplateKey.cs
- ADMembershipUser.cs
- HtmlButton.cs
- WebCategoryAttribute.cs
- HttpApplicationStateWrapper.cs
- ColorInterpolationModeValidation.cs
- mediaeventshelper.cs
- DefaultWorkflowTransactionService.cs
- ReaderOutput.cs
- DomNameTable.cs
- GeometryDrawing.cs
- InvalidProgramException.cs
- XmlQueryTypeFactory.cs
- Vector3dCollection.cs
- SpellerInterop.cs
- SafeUserTokenHandle.cs
- PropertyEmitter.cs
- EntityCommandCompilationException.cs
- ToolStripContextMenu.cs
- ApplicationContext.cs
- TextTreeFixupNode.cs
- SessionIDManager.cs
- ADMembershipUser.cs
- ListBindingConverter.cs
- ApplicationInterop.cs
- SourceElementsCollection.cs
- MILUtilities.cs
- SoapElementAttribute.cs
- RepeaterItemCollection.cs
- Classification.cs
- entityreference_tresulttype.cs
- AsyncResult.cs
- SqlNodeAnnotations.cs
- FontResourceCache.cs
- MatrixUtil.cs
- GridViewColumn.cs