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
- TextTabProperties.cs
- RegexCode.cs
- UrlEncodedParameterWriter.cs
- TextStore.cs
- WindowsListViewScroll.cs
- DesignerToolboxInfo.cs
- Int16Converter.cs
- NoResizeHandleGlyph.cs
- ThreadAttributes.cs
- PasswordBoxAutomationPeer.cs
- HtmlInputReset.cs
- FunctionParameter.cs
- CleanUpVirtualizedItemEventArgs.cs
- ReaderContextStackData.cs
- LoginName.cs
- NonVisualControlAttribute.cs
- Misc.cs
- COM2ComponentEditor.cs
- ObjectListFieldsPage.cs
- ObjectList.cs
- VariableDesigner.xaml.cs
- PropertyChangeTracker.cs
- util.cs
- TransformDescriptor.cs
- UnsafeNativeMethods.cs
- PersonalizationStateInfo.cs
- ExpressionValueEditor.cs
- DataGridView.cs
- CodeIdentifiers.cs
- Polyline.cs
- LabelTarget.cs
- TemplateColumn.cs
- DesignerValidationSummaryAdapter.cs
- OracleBoolean.cs
- ConfigurationSectionGroup.cs
- WebServiceEnumData.cs
- BinaryObjectReader.cs
- XmlSerializerSection.cs
- DateTimeConstantAttribute.cs
- DateTimeAutomationPeer.cs
- Char.cs
- ComplexObject.cs
- SafeCryptContextHandle.cs
- SponsorHelper.cs
- WindowsComboBox.cs
- WebPartEditorOkVerb.cs
- UniqueCodeIdentifierScope.cs
- DefaultValueTypeConverter.cs
- StringSource.cs
- PrePrepareMethodAttribute.cs
- CompiledQuery.cs
- dataprotectionpermissionattribute.cs
- SchemaUtility.cs
- DataList.cs
- TaskForm.cs
- _UncName.cs
- DbMetaDataCollectionNames.cs
- configsystem.cs
- ValueType.cs
- DropDownList.cs
- TextSelectionHighlightLayer.cs
- ModelFunctionTypeElement.cs
- RectAnimationClockResource.cs
- FormsAuthenticationTicket.cs
- SystemKeyConverter.cs
- BufferedReceiveElement.cs
- CodePropertyReferenceExpression.cs
- SqlRowUpdatingEvent.cs
- TrackingServices.cs
- HtmlControlPersistable.cs
- Compiler.cs
- HttpPostedFileWrapper.cs
- CheckPair.cs
- IIS7UserPrincipal.cs
- EncodingDataItem.cs
- AccessedThroughPropertyAttribute.cs
- UpdatePanelTriggerCollection.cs
- ControlBuilder.cs
- securitymgrsite.cs
- ReadOnlyTernaryTree.cs
- HtmlTableCell.cs
- HttpHandlersSection.cs
- SubordinateTransaction.cs
- HandledEventArgs.cs
- PrintPreviewGraphics.cs
- SoapTypeAttribute.cs
- SqlMethodAttribute.cs
- EventToken.cs
- HwndHostAutomationPeer.cs
- Model3DGroup.cs
- LocalizableResourceBuilder.cs
- XmlNamespaceDeclarationsAttribute.cs
- BitmapMetadata.cs
- XsltSettings.cs
- ParsedAttributeCollection.cs
- IPEndPoint.cs
- BinHexEncoder.cs
- LoadGrammarCompletedEventArgs.cs
- RSAProtectedConfigurationProvider.cs
- DrawingBrush.cs