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
- TypeLoadException.cs
- StateDesigner.LayoutSelectionGlyph.cs
- SqlProcedureAttribute.cs
- DefaultDialogButtons.cs
- SizeAnimationUsingKeyFrames.cs
- ModelVisual3D.cs
- AudioLevelUpdatedEventArgs.cs
- MdImport.cs
- SqlUtils.cs
- TagMapInfo.cs
- XmlObjectSerializerContext.cs
- AsyncPostBackTrigger.cs
- WindowsAuthenticationModule.cs
- SafeEventHandle.cs
- EmptyReadOnlyDictionaryInternal.cs
- ConfigErrorGlyph.cs
- XPathAncestorQuery.cs
- ContentElement.cs
- ObfuscationAttribute.cs
- GenericXmlSecurityTokenAuthenticator.cs
- PaginationProgressEventArgs.cs
- BaseCodePageEncoding.cs
- Menu.cs
- SecurityMessageProperty.cs
- TextParagraphView.cs
- MessageBox.cs
- EntityDataSourceColumn.cs
- ConfigXmlReader.cs
- AncillaryOps.cs
- ServiceModelStringsVersion1.cs
- ScriptControlDescriptor.cs
- TextBox.cs
- NativeMethods.cs
- UIElement.cs
- MemberPath.cs
- SecurityDescriptor.cs
- RemoteWebConfigurationHost.cs
- SamlAuthorizationDecisionStatement.cs
- KeyToListMap.cs
- RenderData.cs
- FunctionParameter.cs
- ParsedAttributeCollection.cs
- DependencyObject.cs
- PolyLineSegmentFigureLogic.cs
- GraphicsContainer.cs
- FunctionUpdateCommand.cs
- ListViewItem.cs
- EndCreateSecurityTokenRequest.cs
- FormatConvertedBitmap.cs
- ChtmlFormAdapter.cs
- WebConfigurationHostFileChange.cs
- RegexReplacement.cs
- FtpWebRequest.cs
- SQLUtility.cs
- _ScatterGatherBuffers.cs
- LayoutExceptionEventArgs.cs
- ActivityScheduledQuery.cs
- NameSpaceExtractor.cs
- lengthconverter.cs
- DoubleLinkListEnumerator.cs
- TreeNodeConverter.cs
- Stopwatch.cs
- RSAPKCS1SignatureFormatter.cs
- RegionData.cs
- NavigationService.cs
- TrueReadOnlyCollection.cs
- QueueProcessor.cs
- LayoutUtils.cs
- Point.cs
- ProfileProvider.cs
- FillBehavior.cs
- RelationshipSet.cs
- X509Utils.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- ContextMarshalException.cs
- ExpressionNode.cs
- WmlFormAdapter.cs
- BaseUriHelper.cs
- SQLGuid.cs
- TextEndOfSegment.cs
- XamlParser.cs
- ColumnMapTranslator.cs
- DirectoryGroupQuery.cs
- VectorKeyFrameCollection.cs
- AutoResizedEvent.cs
- InputLangChangeRequestEvent.cs
- SqlMethodAttribute.cs
- dataprotectionpermission.cs
- TextElementCollection.cs
- QilName.cs
- XmlSchemaExternal.cs
- SqlConnectionString.cs
- QueuePathEditor.cs
- TraceUtility.cs
- ProjectionPathSegment.cs
- DiscoveryReferences.cs
- PrinterResolution.cs
- ScriptDescriptor.cs
- DataGridTextBox.cs
- Compiler.cs