Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / TagMapCollection.cs / 1305376 / TagMapCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; using System.Web.Util; using System.Web.UI; using System.Web.Compilation; using System.Threading; using System.Web.Configuration; using System.Security.Permissions; [ConfigurationCollection(typeof(TagMapInfo))] public sealed class TagMapCollection : ConfigurationElementCollection { private static ConfigurationPropertyCollection _properties; private Hashtable _tagMappings; static TagMapCollection() { // Property initialization _properties = new ConfigurationPropertyCollection(); } public TagMapCollection() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } public TagMapInfo this[int index] { get { return (TagMapInfo)BaseGet(index); } set { if (BaseGet(index) != null) { BaseRemoveAt(index); } BaseAdd(index, value); } } public void Add(TagMapInfo tagMapInformation) { BaseAdd(tagMapInformation); } public void Remove(TagMapInfo tagMapInformation) { BaseRemove(GetElementKey(tagMapInformation)); } public void Clear() { BaseClear(); } protected override ConfigurationElement CreateNewElement() { return new TagMapInfo(); } protected override Object GetElementKey(ConfigurationElement element) { return ((TagMapInfo)element).TagType; } internal Hashtable TagTypeMappingInternal { get { if (_tagMappings == null) { lock (this) { if (_tagMappings == null) { Hashtable tagMappings = new Hashtable(StringComparer.OrdinalIgnoreCase); foreach (TagMapInfo tmi in this) { Type tagType = ConfigUtil.GetType(tmi.TagType, "tagType", tmi); Type mappedTagType = ConfigUtil.GetType(tmi.MappedTagType, "mappedTagType", tmi); if (tagType.IsAssignableFrom(mappedTagType) == false) { throw new ConfigurationErrorsException( SR.GetString( SR.Mapped_type_must_inherit, tmi.MappedTagType, tmi.TagType), tmi.ElementInformation.Properties["mappedTagType"].Source, tmi.ElementInformation.Properties["mappedTagType"].LineNumber); } tagMappings[tagType] = mappedTagType; } _tagMappings = tagMappings; } } } return _tagMappings; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XhtmlConformanceSection.cs
- ClientSettingsSection.cs
- SpellerError.cs
- WebPartHeaderCloseVerb.cs
- MenuItemCollection.cs
- LineUtil.cs
- ObjectViewFactory.cs
- EntityDataSourceContextCreatingEventArgs.cs
- PersistChildrenAttribute.cs
- XmlElementList.cs
- BooleanConverter.cs
- EditorPartCollection.cs
- HandlerBase.cs
- WebFaultClientMessageInspector.cs
- HttpResponseHeader.cs
- MDIWindowDialog.cs
- TypeUnloadedException.cs
- LiteralControl.cs
- PrincipalPermission.cs
- TextDecorationCollection.cs
- NavigationExpr.cs
- Menu.cs
- HasRunnableWorkflowEvent.cs
- CodeSubDirectory.cs
- OrCondition.cs
- WindowsEditBox.cs
- ScrollBar.cs
- QueryContinueDragEventArgs.cs
- LiteralDesigner.cs
- GridViewCancelEditEventArgs.cs
- WhitespaceRuleLookup.cs
- QueryReaderSettings.cs
- EntityDataSourceContextCreatingEventArgs.cs
- NativeMethods.cs
- ClockController.cs
- ProgressBarRenderer.cs
- RegisteredScript.cs
- WindowsClaimSet.cs
- NonVisualControlAttribute.cs
- ContentPropertyAttribute.cs
- ProfileEventArgs.cs
- AstTree.cs
- WebBrowserBase.cs
- Group.cs
- Compiler.cs
- GradientStop.cs
- SafeProcessHandle.cs
- FormViewRow.cs
- RTLAwareMessageBox.cs
- StylusCaptureWithinProperty.cs
- DataGridViewRowPostPaintEventArgs.cs
- ResXResourceWriter.cs
- HttpRuntimeSection.cs
- Assert.cs
- PeerValidationBehavior.cs
- TextPointerBase.cs
- CollectionType.cs
- DataGridHeaderBorder.cs
- ForwardPositionQuery.cs
- CodeLabeledStatement.cs
- ObjectManager.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- SapiInterop.cs
- Slider.cs
- ImportCatalogPart.cs
- SafeRightsManagementHandle.cs
- BindingManagerDataErrorEventArgs.cs
- ConfigurationCollectionAttribute.cs
- AssemblyResourceLoader.cs
- SequentialWorkflowHeaderFooter.cs
- FloatMinMaxAggregationOperator.cs
- StringAnimationBase.cs
- FactoryRecord.cs
- CustomPopupPlacement.cs
- NavigationEventArgs.cs
- BooleanExpr.cs
- SignatureDescription.cs
- CodePageEncoding.cs
- ListCollectionView.cs
- MessageFilterTable.cs
- CodeConditionStatement.cs
- ConsoleKeyInfo.cs
- ApplicationFileParser.cs
- ConfigurationStrings.cs
- DocumentViewerBase.cs
- StopStoryboard.cs
- MailDefinition.cs
- LoginStatusDesigner.cs
- LinkLabel.cs
- XamlReaderHelper.cs
- EntityProviderFactory.cs
- QueryTaskGroupState.cs
- ItemCheckedEvent.cs
- StyleSelector.cs
- StateDesignerConnector.cs
- GeometryModel3D.cs
- ProfileSettings.cs
- XmlSchemaCollection.cs
- ClientTargetSection.cs
- RelationshipManager.cs