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
- CallbackHandler.cs
- ExtentCqlBlock.cs
- CanonicalFontFamilyReference.cs
- GACMembershipCondition.cs
- MemberPath.cs
- SpotLight.cs
- SqlMethodTransformer.cs
- AccessControlList.cs
- PeerInputChannelListener.cs
- SamlAction.cs
- ValidationError.cs
- Relationship.cs
- Faults.cs
- _HeaderInfo.cs
- SettingsSavedEventArgs.cs
- Serializer.cs
- BoundField.cs
- ImageSource.cs
- DataKey.cs
- IssuerInformation.cs
- HtmlString.cs
- StartUpEventArgs.cs
- ViewStateException.cs
- TopClause.cs
- PasswordRecovery.cs
- HtmlElementErrorEventArgs.cs
- SevenBitStream.cs
- TraceHandler.cs
- HtmlInputHidden.cs
- ToolStripInSituService.cs
- ItemCollectionEditor.cs
- SafeEventLogWriteHandle.cs
- DSASignatureFormatter.cs
- MDIControlStrip.cs
- TabControl.cs
- ResolveCompletedEventArgs.cs
- HttpWebRequestElement.cs
- TableProviderWrapper.cs
- CachedFontFamily.cs
- ListenerElementsCollection.cs
- BehaviorEditorPart.cs
- ModifierKeysConverter.cs
- dataobject.cs
- XmlSchemaImport.cs
- GraphicsPathIterator.cs
- PackageDigitalSignature.cs
- XmlComplianceUtil.cs
- ISAPIApplicationHost.cs
- NullRuntimeConfig.cs
- RequestResponse.cs
- CuspData.cs
- NumericExpr.cs
- WebExceptionStatus.cs
- ApplicationFileParser.cs
- PerformanceCounterCategory.cs
- SelectedPathEditor.cs
- InputQueue.cs
- NamespaceCollection.cs
- AutomationTextAttribute.cs
- DataGridCellInfo.cs
- ItemAutomationPeer.cs
- NetMsmqSecurityMode.cs
- AuthenticationException.cs
- SchemaImporter.cs
- WebPartManagerInternals.cs
- SkinBuilder.cs
- TransactionCache.cs
- GlyphRunDrawing.cs
- ProfileEventArgs.cs
- HighlightVisual.cs
- RestHandlerFactory.cs
- RevocationPoint.cs
- AssociationTypeEmitter.cs
- TextServicesHost.cs
- XmlNodeChangedEventManager.cs
- ToolStripButton.cs
- PenContext.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- CfgParser.cs
- XmlSecureResolver.cs
- OleDbFactory.cs
- ItemsChangedEventArgs.cs
- EntitySqlQueryCacheKey.cs
- HandlerElementCollection.cs
- AssemblyUtil.cs
- Point4DConverter.cs
- HTMLTextWriter.cs
- backend.cs
- NullRuntimeConfig.cs
- DefaultValueTypeConverter.cs
- ClientSideProviderDescription.cs
- PackageRelationshipSelector.cs
- OleDragDropHandler.cs
- ProjectionQueryOptionExpression.cs
- ExpressionTextBoxAutomationPeer.cs
- ContextMenuStrip.cs
- EventListener.cs
- FastEncoderWindow.cs
- OleAutBinder.cs
- DataGridViewRowConverter.cs