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
- SchemaConstraints.cs
- GeometryDrawing.cs
- Rules.cs
- Pkcs7Recipient.cs
- CodeTryCatchFinallyStatement.cs
- DependentList.cs
- TextServicesManager.cs
- FixedSOMTextRun.cs
- MultiSelector.cs
- TypeNameHelper.cs
- EventData.cs
- Brush.cs
- VariantWrapper.cs
- IisTraceListener.cs
- CompleteWizardStep.cs
- ColorMap.cs
- TdsParserStateObject.cs
- TypedServiceChannelBuilder.cs
- ProcessHostMapPath.cs
- _IPv6Address.cs
- DataBinding.cs
- IHttpResponseInternal.cs
- TranslateTransform.cs
- RenderDataDrawingContext.cs
- XmlNodeChangedEventManager.cs
- TreeViewItemAutomationPeer.cs
- FileResponseElement.cs
- UInt64Converter.cs
- WrappedReader.cs
- ListChangedEventArgs.cs
- BackgroundFormatInfo.cs
- GetPageCompletedEventArgs.cs
- ScaleTransform.cs
- ProxyFragment.cs
- HuffModule.cs
- ListViewGroup.cs
- BitmapEncoder.cs
- SolidColorBrush.cs
- MethodBody.cs
- CompletionProxy.cs
- DataGridItemCollection.cs
- UIntPtr.cs
- TemplateControlCodeDomTreeGenerator.cs
- KeysConverter.cs
- ExceptionValidationRule.cs
- CommonDialog.cs
- MessageProtectionOrder.cs
- RoutedEventConverter.cs
- COM2EnumConverter.cs
- SessionKeyExpiredException.cs
- AnnotationResourceCollection.cs
- ToolStripItemClickedEventArgs.cs
- DataGridViewImageCell.cs
- OleDbParameter.cs
- ImageBrush.cs
- IdleTimeoutMonitor.cs
- SqlDataSourceStatusEventArgs.cs
- NamespaceDisplay.xaml.cs
- SQLString.cs
- ValueTable.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- ConfigurationElementCollection.cs
- ToolbarAUtomationPeer.cs
- AttachedPropertiesService.cs
- CheckBoxAutomationPeer.cs
- UnSafeCharBuffer.cs
- ZipIOCentralDirectoryBlock.cs
- XPathAncestorQuery.cs
- SqlDataSource.cs
- TableLayoutColumnStyleCollection.cs
- DataTableNewRowEvent.cs
- ActivityDesignerLayoutSerializers.cs
- GrammarBuilderDictation.cs
- MetadataUtilsSmi.cs
- ListBoxItemWrapperAutomationPeer.cs
- MonthCalendarDesigner.cs
- TimeEnumHelper.cs
- SafeFileHandle.cs
- ConfigDefinitionUpdates.cs
- GeneralTransform3DGroup.cs
- WindowsGrip.cs
- SyntaxCheck.cs
- DesignerDeviceConfig.cs
- XPathDocumentBuilder.cs
- GroupDescription.cs
- RegionInfo.cs
- XD.cs
- ScriptReferenceBase.cs
- PictureBox.cs
- MatrixTransform.cs
- WebBrowserNavigatingEventHandler.cs
- ResourceExpressionBuilder.cs
- HorizontalAlignConverter.cs
- JpegBitmapEncoder.cs
- MsmqOutputMessage.cs
- RegexNode.cs
- TextMarkerSource.cs
- CodeAttributeArgumentCollection.cs
- ProviderCommandInfoUtils.cs
- Bits.cs