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
- IISMapPath.cs
- StreamUpdate.cs
- ToolStripDropDownClosedEventArgs.cs
- RelationshipConstraintValidator.cs
- DbgUtil.cs
- MimeReturn.cs
- ConvertEvent.cs
- SigningCredentials.cs
- MaskDescriptors.cs
- PeerCustomResolverElement.cs
- StoreConnection.cs
- KeyboardNavigation.cs
- ConcatQueryOperator.cs
- TextDpi.cs
- SafeArchiveContext.cs
- SolidBrush.cs
- UseLicense.cs
- FormView.cs
- PerformanceCounterManager.cs
- ProcessModelInfo.cs
- Timeline.cs
- Renderer.cs
- ExternalException.cs
- HtmlSelect.cs
- PageAsyncTaskManager.cs
- Scheduler.cs
- CorrelationQuery.cs
- XamlSerializerUtil.cs
- CacheMode.cs
- DateTimeConverter2.cs
- Rules.cs
- WorkflowItemPresenter.cs
- DbQueryCommandTree.cs
- WebPartTracker.cs
- DataGridViewAddColumnDialog.cs
- TileBrush.cs
- DoubleKeyFrameCollection.cs
- LightweightCodeGenerator.cs
- ListMarkerLine.cs
- OLEDB_Util.cs
- DataObjectCopyingEventArgs.cs
- TraceSection.cs
- LicFileLicenseProvider.cs
- LoginView.cs
- ConsoleEntryPoint.cs
- PerformanceCounterPermission.cs
- DetailsViewInsertedEventArgs.cs
- CacheDependency.cs
- SimplePropertyEntry.cs
- UpdatePanelTriggerCollection.cs
- VectorAnimationUsingKeyFrames.cs
- CompiledQuery.cs
- MethodCallExpression.cs
- BindingEditor.xaml.cs
- UInt64Storage.cs
- ZipIOExtraFieldPaddingElement.cs
- DateTimeFormatInfo.cs
- ClientTarget.cs
- NumericUpDown.cs
- GrammarBuilderRuleRef.cs
- OleDbWrapper.cs
- ConfigurationElementCollection.cs
- ValidationPropertyAttribute.cs
- SQLConvert.cs
- DoubleLinkListEnumerator.cs
- DataGridViewRowPrePaintEventArgs.cs
- FormatterConverter.cs
- XmlCharacterData.cs
- GPStream.cs
- SafeCloseHandleCritical.cs
- EventBookmark.cs
- PropertyMetadata.cs
- ButtonAutomationPeer.cs
- ObjectStateEntryDbDataRecord.cs
- ToolBarButton.cs
- SubclassTypeValidatorAttribute.cs
- MD5.cs
- ToolTip.cs
- EncoderExceptionFallback.cs
- Registry.cs
- EndpointDiscoveryMetadata11.cs
- Queue.cs
- SponsorHelper.cs
- NamedPipeActivation.cs
- DataSourceView.cs
- WebUtil.cs
- SqlClientFactory.cs
- ChtmlPageAdapter.cs
- ReferenceService.cs
- Wildcard.cs
- SecurityUtils.cs
- UpDownBase.cs
- FormViewCommandEventArgs.cs
- InlineObject.cs
- TableCell.cs
- ArrayConverter.cs
- HyperLink.cs
- CopyOfAction.cs
- UpnEndpointIdentityExtension.cs
- AspNetHostingPermission.cs