Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Configuration / ConvertersCollection.cs / 1305376 / ConvertersCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Collections.Generic; using System.Configuration; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Web; using System.Web.Compilation; using System.Web.Resources; using System.Web.Script.Serialization; using System.Security; [ ConfigurationCollection(typeof(Converter)), SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface", Justification="Derives from legacy collection base class. Base method IsReadOnly() " + "would clash with property ICollection.IsReadOnly.") ] public class ConvertersCollection : ConfigurationElementCollection { private static readonly ConfigurationPropertyCollection _properties = new ConfigurationPropertyCollection(); public ConvertersCollection() { } [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] protected override ConfigurationPropertyCollection Properties { get { return _properties; } } public Converter this[int index] { get { return (Converter)BaseGet(index); } set { if (BaseGet(index) != null) { BaseRemoveAt(index); } BaseAdd(index, value); } } public void Add(Converter converter) { BaseAdd(converter); } public void Remove(Converter converter) { BaseRemove(GetElementKey(converter)); } public void Clear() { BaseClear(); } [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] protected override ConfigurationElement CreateNewElement() { return new Converter(); } [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] protected override Object GetElementKey(ConfigurationElement element) { return ((Converter)element).Name; } [SecuritySafeCritical] internal JavaScriptConverter[] CreateConverters() { List list = new List (); foreach (Converter converter in this) { Type t = BuildManager.GetType(converter.Type, false /*throwOnError*/); if (t == null) { throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, AtlasWeb.ConvertersCollection_UnknownType, converter.Type)); } if (!typeof(JavaScriptConverter).IsAssignableFrom(t)) { throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, AtlasWeb.ConvertersCollection_NotJavaScriptConverter, t.Name)); } list.Add((JavaScriptConverter)Activator.CreateInstance(t)); } return list.ToArray(); } } } // 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
- IPipelineRuntime.cs
- TriggerAction.cs
- DataServiceKeyAttribute.cs
- Collection.cs
- DecoderFallbackWithFailureFlag.cs
- SecurityPolicySection.cs
- Barrier.cs
- IndexedString.cs
- BitmapEffectOutputConnector.cs
- XmlLangPropertyAttribute.cs
- DataKey.cs
- HtmlEmptyTagControlBuilder.cs
- DelegatedStream.cs
- CallSiteHelpers.cs
- UrlPath.cs
- PeerMessageDispatcher.cs
- AdapterDictionary.cs
- Int16Converter.cs
- EditorPartDesigner.cs
- SystemThemeKey.cs
- AttachmentCollection.cs
- ReflectionUtil.cs
- DirectionalLight.cs
- RelatedImageListAttribute.cs
- Size.cs
- DbMetaDataCollectionNames.cs
- ReleaseInstanceMode.cs
- InvalidCastException.cs
- FieldAccessException.cs
- RTTypeWrapper.cs
- JobDuplex.cs
- DirectoryRootQuery.cs
- ProcessHostMapPath.cs
- ConfigurationSectionHelper.cs
- MetaType.cs
- DocumentsTrace.cs
- WinInet.cs
- HandoffBehavior.cs
- RegistryDataKey.cs
- UxThemeWrapper.cs
- Point3D.cs
- CodeSubDirectory.cs
- DbProviderFactories.cs
- SafeRegistryHandle.cs
- XmlImplementation.cs
- RepeatButtonAutomationPeer.cs
- HttpConfigurationContext.cs
- EditorPartChrome.cs
- TableLayoutStyle.cs
- DefaultAsyncDataDispatcher.cs
- DrawingImage.cs
- GraphicsState.cs
- CodeDOMUtility.cs
- METAHEADER.cs
- StringArrayConverter.cs
- BitmapSource.cs
- CommunicationObjectFaultedException.cs
- HostingEnvironmentException.cs
- ArrayList.cs
- FigureParagraph.cs
- DataGridViewCellStyleEditor.cs
- VerificationException.cs
- SystemWebCachingSectionGroup.cs
- TripleDES.cs
- EncryptedType.cs
- HiddenField.cs
- TaskHelper.cs
- GetLedgerRequest.cs
- DiscoveryDocumentLinksPattern.cs
- XmlNodeChangedEventArgs.cs
- StringResourceManager.cs
- UInt16Storage.cs
- path.cs
- AudioFileOut.cs
- ScriptMethodAttribute.cs
- Transform3DGroup.cs
- FileInfo.cs
- MediaContext.cs
- DATA_BLOB.cs
- BindableAttribute.cs
- HMACSHA1.cs
- SecurityTokenReferenceStyle.cs
- PropertyRef.cs
- EmptyArray.cs
- ConstructorExpr.cs
- FrameworkElement.cs
- SymLanguageType.cs
- WorkflowNamespace.cs
- CollectionChangeEventArgs.cs
- MSHTMLHost.cs
- StrokeDescriptor.cs
- DecimalAnimation.cs
- ViewUtilities.cs
- DbConnectionStringBuilder.cs
- WinFormsSecurity.cs
- BStrWrapper.cs
- Line.cs
- SendMailErrorEventArgs.cs
- WinCategoryAttribute.cs
- CachedBitmap.cs