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
- METAHEADER.cs
- SpotLight.cs
- Stroke.cs
- ConstructorNeedsTagAttribute.cs
- InteropBitmapSource.cs
- SspiNegotiationTokenProvider.cs
- SqlWebEventProvider.cs
- RootBrowserWindowProxy.cs
- Axis.cs
- SafeWaitHandle.cs
- TileBrush.cs
- CodeExpressionStatement.cs
- RoleManagerModule.cs
- XmlILStorageConverter.cs
- XpsFilter.cs
- PersonalizableAttribute.cs
- FaultDescriptionCollection.cs
- OutKeywords.cs
- InfoCardKeyedHashAlgorithm.cs
- StrongNamePublicKeyBlob.cs
- KeyGestureConverter.cs
- ExpandedWrapper.cs
- GACIdentityPermission.cs
- TreeView.cs
- AdapterDictionary.cs
- XmlCompatibilityReader.cs
- SendKeys.cs
- Dump.cs
- externdll.cs
- NetTcpSection.cs
- SiteMapDataSourceView.cs
- TreeViewCancelEvent.cs
- DbDataReader.cs
- ImageField.cs
- MetadataArtifactLoaderCompositeFile.cs
- TimeoutException.cs
- UrlParameterWriter.cs
- SqlNotificationRequest.cs
- IERequestCache.cs
- StatusBarItemAutomationPeer.cs
- ItemCollection.cs
- BrowserCapabilitiesCompiler.cs
- TcpAppDomainProtocolHandler.cs
- GlyphInfoList.cs
- RandomNumberGenerator.cs
- TextServicesDisplayAttribute.cs
- DataGridViewCellParsingEventArgs.cs
- RangeContentEnumerator.cs
- basemetadatamappingvisitor.cs
- DecimalFormatter.cs
- MILUtilities.cs
- OdbcConnection.cs
- DbDataAdapter.cs
- UpDownEvent.cs
- RequestCacheManager.cs
- ComponentEditorPage.cs
- WebPartDesigner.cs
- FilteredXmlReader.cs
- COM2EnumConverter.cs
- SafeBitVector32.cs
- DefaultSettingsSection.cs
- SqlParameterizer.cs
- BamlRecordHelper.cs
- DataGridViewComboBoxColumn.cs
- ErrorWrapper.cs
- Cursor.cs
- TreeViewDataItemAutomationPeer.cs
- SQLSingleStorage.cs
- UnsupportedPolicyOptionsException.cs
- Panel.cs
- PageAdapter.cs
- TrackBarRenderer.cs
- ContentControl.cs
- Nodes.cs
- ColorMatrix.cs
- InheritanceContextHelper.cs
- PackWebRequestFactory.cs
- PathSegment.cs
- SqlTriggerContext.cs
- PropertyConverter.cs
- TableLayout.cs
- CDSCollectionETWBCLProvider.cs
- KeyManager.cs
- BindingListCollectionView.cs
- DataSourceCacheDurationConverter.cs
- SapiAttributeParser.cs
- FamilyTypefaceCollection.cs
- DayRenderEvent.cs
- ClientBuildManager.cs
- NonSerializedAttribute.cs
- PreloadedPackages.cs
- dtdvalidator.cs
- PackagePartCollection.cs
- DrawingAttributes.cs
- TcpSocketManager.cs
- RSAPKCS1SignatureFormatter.cs
- IIS7WorkerRequest.cs
- EmptyImpersonationContext.cs
- TemplateBamlRecordReader.cs
- DiagnosticTrace.cs