Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / ExtensionElementCollection.cs / 1 / ExtensionElementCollection.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System; using System.Configuration; [ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMap)] public class ExtensionElementCollection : ServiceModelConfigurationElementCollection{ public ExtensionElementCollection() : base(ConfigurationElementCollectionType.BasicMap, ConfigurationStrings.Add) { } protected override void BaseAdd(ConfigurationElement element) { this.EnforceUniqueElement((ExtensionElement)element); base.BaseAdd(element); } protected override void BaseAdd(int index, ConfigurationElement element) { this.EnforceUniqueElement((ExtensionElement)element); base.BaseAdd(index, element); } protected override object GetElementKey(ConfigurationElement element) { if (null == element) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element"); } ExtensionElement configElementKey = (ExtensionElement) element; return configElementKey.Name; } void EnforceUniqueElement(ExtensionElement element) { Type elementType = Type.GetType(element.Type, false); foreach (ExtensionElement extension in this) { if (element.Name.Equals(extension.Name, StringComparison.Ordinal)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException( SR.GetString(SR.ConfigDuplicateExtensionName, element.Name))); } if (null != elementType) { if (elementType.Equals(Type.GetType(extension.Type, false))) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException( SR.GetString(SR.ConfigDuplicateExtensionType, element.Type))); } } else { if (element.Type.Equals(extension.Type, StringComparison.OrdinalIgnoreCase)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException( SR.GetString(SR.ConfigDuplicateExtensionType, element.Type))); } } } } protected override bool ThrowOnDuplicate { get { return true; } } } } // 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
- IndexingContentUnit.cs
- ProxyWebPartConnectionCollection.cs
- Version.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- DebugInfoExpression.cs
- DesignerDataParameter.cs
- SpecialFolderEnumConverter.cs
- XamlReaderHelper.cs
- TypeDependencyAttribute.cs
- log.cs
- DbSourceParameterCollection.cs
- NamespaceInfo.cs
- WaitHandleCannotBeOpenedException.cs
- PropertyPathConverter.cs
- MethodToken.cs
- MULTI_QI.cs
- DataObjectSettingDataEventArgs.cs
- BamlTreeNode.cs
- PngBitmapDecoder.cs
- AsyncPostBackTrigger.cs
- ExpressionEditor.cs
- DataControlFieldHeaderCell.cs
- WmlControlAdapter.cs
- SQLGuid.cs
- CommandManager.cs
- SettingsProviderCollection.cs
- CategoryAttribute.cs
- ThumbAutomationPeer.cs
- StringAnimationUsingKeyFrames.cs
- CornerRadius.cs
- DocumentPageHost.cs
- DataMemberListEditor.cs
- WaitForChangedResult.cs
- TripleDES.cs
- WebPartDisplayMode.cs
- WebPartHelpVerb.cs
- ITreeGenerator.cs
- unsafeIndexingFilterStream.cs
- AutoScrollExpandMessageFilter.cs
- Journaling.cs
- GlobalProxySelection.cs
- ApplicationInfo.cs
- OperationInfo.cs
- autovalidator.cs
- InputBinding.cs
- DataGridTableCollection.cs
- GenericUriParser.cs
- MetadataItemCollectionFactory.cs
- LostFocusEventManager.cs
- CodeGenerationManager.cs
- ConfigurationManagerHelperFactory.cs
- ConnectionPointGlyph.cs
- CustomTokenProvider.cs
- XmlBindingWorker.cs
- Win32Interop.cs
- ScrollChangedEventArgs.cs
- XPathEmptyIterator.cs
- SettingsPropertyCollection.cs
- FactoryGenerator.cs
- WebEventTraceProvider.cs
- ElementMarkupObject.cs
- XmlAttributeOverrides.cs
- CfgParser.cs
- PlanCompilerUtil.cs
- TypeConverterAttribute.cs
- CommandEventArgs.cs
- BypassElementCollection.cs
- WebPartHeaderCloseVerb.cs
- XmlSchemaAll.cs
- StandardTransformFactory.cs
- PublisherIdentityPermission.cs
- XPathNodeIterator.cs
- ElementNotEnabledException.cs
- SliderAutomationPeer.cs
- GeneratedView.cs
- OLEDB_Enum.cs
- TabOrder.cs
- SharedStream.cs
- CleanUpVirtualizedItemEventArgs.cs
- SAPICategories.cs
- Script.cs
- EncoderFallback.cs
- SemanticResolver.cs
- DataGridViewIntLinkedList.cs
- HttpWebRequestElement.cs
- SessionStateContainer.cs
- DesignerRegionCollection.cs
- TimeManager.cs
- DataGridViewControlCollection.cs
- listitem.cs
- UpdatePanel.cs
- PeerEndPoint.cs
- BrowserTree.cs
- CodeAttributeDeclaration.cs
- CodeSubDirectory.cs
- Delegate.cs
- TransformerInfo.cs
- PublisherIdentityPermission.cs
- OperationAbortedException.cs
- Pen.cs