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
- invalidudtexception.cs
- DataObjectMethodAttribute.cs
- ProcessHostServerConfig.cs
- DataColumnCollection.cs
- Line.cs
- ObjectViewFactory.cs
- ToolBarPanel.cs
- XmlAnyElementAttributes.cs
- ProjectionAnalyzer.cs
- InternalCache.cs
- InputLanguageSource.cs
- SaveFileDialog.cs
- BoundColumn.cs
- DefaultBindingPropertyAttribute.cs
- ListSourceHelper.cs
- MessageEncoder.cs
- ActivityCodeDomSerializer.cs
- WpfPayload.cs
- ExitEventArgs.cs
- BrowsableAttribute.cs
- WebPartRestoreVerb.cs
- AnimationClockResource.cs
- ScrollData.cs
- DependencyObjectType.cs
- SchemaImporterExtensionElement.cs
- SecurityKeyUsage.cs
- MultiTouchSystemGestureLogic.cs
- BamlLocalizableResource.cs
- RegexCompiler.cs
- ExtensionElement.cs
- StylusPointProperty.cs
- MetadataCache.cs
- RoleGroupCollectionEditor.cs
- EdmToObjectNamespaceMap.cs
- Int16.cs
- BufferedGraphicsManager.cs
- ResourceContainer.cs
- ToolStripSeparatorRenderEventArgs.cs
- SubstitutionResponseElement.cs
- AsymmetricKeyExchangeFormatter.cs
- WindowsScrollBarBits.cs
- CompilerError.cs
- SessionIDManager.cs
- ColumnHeader.cs
- PreparingEnlistment.cs
- XmlSchemaFacet.cs
- ParseNumbers.cs
- Size3DValueSerializer.cs
- Command.cs
- ReadOnlyHierarchicalDataSource.cs
- MetaChildrenColumn.cs
- Schema.cs
- HttpPostedFile.cs
- LambdaCompiler.Lambda.cs
- XmlComplianceUtil.cs
- DescendantBaseQuery.cs
- BitmapMetadataBlob.cs
- WebPartDisplayMode.cs
- RegistrySecurity.cs
- NullableIntMinMaxAggregationOperator.cs
- StyleTypedPropertyAttribute.cs
- DetailsViewPagerRow.cs
- __FastResourceComparer.cs
- QueryTask.cs
- DataViewManager.cs
- ScriptingProfileServiceSection.cs
- DBCSCodePageEncoding.cs
- FocusManager.cs
- StateManagedCollection.cs
- AudioBase.cs
- GeneralTransform3DTo2D.cs
- ConfigurationSection.cs
- FormViewUpdatedEventArgs.cs
- DockingAttribute.cs
- AsyncPostBackErrorEventArgs.cs
- QilChoice.cs
- TemplateBindingExtensionConverter.cs
- ConditionCollection.cs
- LinkedList.cs
- shaper.cs
- SqlComparer.cs
- SlotInfo.cs
- CommandConverter.cs
- OdbcConnectionOpen.cs
- WithStatement.cs
- RegexMatch.cs
- SoapElementAttribute.cs
- SiteMapNodeItem.cs
- WebRequest.cs
- ControlBuilderAttribute.cs
- FixedTextView.cs
- TextCharacters.cs
- DbConnectionOptions.cs
- PermissionSetTriple.cs
- Monitor.cs
- IDispatchConstantAttribute.cs
- sqlstateclientmanager.cs
- PolyQuadraticBezierSegment.cs
- Internal.cs
- LockedActivityGlyph.cs