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
- DocumentPaginator.cs
- Win32Native.cs
- newinstructionaction.cs
- ClaimComparer.cs
- CheckPair.cs
- List.cs
- UnsafeNativeMethods.cs
- DbProviderManifest.cs
- SmiEventStream.cs
- WindowsMenu.cs
- AddInController.cs
- COM2Properties.cs
- KeyGesture.cs
- RemoveStoryboard.cs
- UidManager.cs
- Msec.cs
- NamespaceEmitter.cs
- Hex.cs
- HttpPostLocalhostServerProtocol.cs
- SchemaMerger.cs
- Timer.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- DependentList.cs
- OutputCacheModule.cs
- ClientSettingsProvider.cs
- ResolvedKeyFrameEntry.cs
- SiteMapDataSource.cs
- ValuePattern.cs
- CalendarDateRange.cs
- WebPartMenu.cs
- RelatedPropertyManager.cs
- XmlReader.cs
- GreenMethods.cs
- WeakReferenceKey.cs
- VerificationException.cs
- XmlIgnoreAttribute.cs
- ControlOperationInvoker.cs
- ContentDisposition.cs
- SqlProfileProvider.cs
- HostingEnvironmentWrapper.cs
- MaskDesignerDialog.cs
- HttpHandlersSection.cs
- Error.cs
- BackgroundFormatInfo.cs
- MatrixStack.cs
- ConfigXmlComment.cs
- FormViewRow.cs
- Int32CollectionValueSerializer.cs
- OleDbException.cs
- XsdBuildProvider.cs
- SQLCharsStorage.cs
- EventsTab.cs
- TableLayoutPanelCodeDomSerializer.cs
- FixedSOMTextRun.cs
- FixUpCollection.cs
- RtfControlWordInfo.cs
- UnsignedPublishLicense.cs
- FormConverter.cs
- DesignerProperties.cs
- ModelVisual3D.cs
- ThreadAbortException.cs
- CodeAssignStatement.cs
- DescendantBaseQuery.cs
- FloatSumAggregationOperator.cs
- AccessDataSourceWizardForm.cs
- OTFRasterizer.cs
- WebPartCatalogCloseVerb.cs
- EntityObject.cs
- DataGridViewComboBoxCell.cs
- ParagraphVisual.cs
- NavigationHelper.cs
- XmlAggregates.cs
- ModelTypeConverter.cs
- EnumConverter.cs
- Imaging.cs
- IList.cs
- WebPageTraceListener.cs
- XamlVector3DCollectionSerializer.cs
- XmlDataDocument.cs
- DefaultTypeArgumentAttribute.cs
- DataGridSortCommandEventArgs.cs
- BamlTreeUpdater.cs
- NetworkStream.cs
- OutputCacheSettingsSection.cs
- MetadataUtil.cs
- MediaTimeline.cs
- XmlElementCollection.cs
- SmtpReplyReader.cs
- StringHandle.cs
- MimeTypeAttribute.cs
- Profiler.cs
- FixedPageStructure.cs
- MediaContext.cs
- MetadataArtifactLoader.cs
- StorageInfo.cs
- RoutingUtilities.cs
- processwaithandle.cs
- TablePattern.cs
- CodeTryCatchFinallyStatement.cs
- SplashScreenNativeMethods.cs