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
- XmlnsCompatibleWithAttribute.cs
- DbDataRecord.cs
- ToolStripItemClickedEventArgs.cs
- VisualBasicHelper.cs
- BindingOperations.cs
- DbParameterCollection.cs
- ConfigsHelper.cs
- CodeDomLocalizationProvider.cs
- XmlSchemaException.cs
- PlaceHolder.cs
- CanonicalizationDriver.cs
- _SslSessionsCache.cs
- UIElementParagraph.cs
- RetrieveVirtualItemEventArgs.cs
- Item.cs
- MessageEnumerator.cs
- DocumentationServerProtocol.cs
- X509SecurityTokenProvider.cs
- SqlWorkflowInstanceStore.cs
- DecimalConstantAttribute.cs
- EpmHelper.cs
- ListViewGroupCollectionEditor.cs
- MultiAsyncResult.cs
- AsymmetricCryptoHandle.cs
- UnionCqlBlock.cs
- HelpKeywordAttribute.cs
- Span.cs
- Trigger.cs
- TypeDependencyAttribute.cs
- AddInControllerImpl.cs
- KernelTypeValidation.cs
- ThreadAbortException.cs
- ChannelBinding.cs
- SafeMILHandle.cs
- Rect3D.cs
- X509CertificateValidator.cs
- Help.cs
- Mappings.cs
- Latin1Encoding.cs
- DependencyObject.cs
- StrongNameMembershipCondition.cs
- FormViewPagerRow.cs
- _LoggingObject.cs
- ValidationError.cs
- HtmlInputFile.cs
- DataGridCaption.cs
- MachineSettingsSection.cs
- GroupBoxRenderer.cs
- PrintDialog.cs
- AccessDataSource.cs
- WebBrowserDocumentCompletedEventHandler.cs
- ClonableStack.cs
- XmlLangPropertyAttribute.cs
- SafeRightsManagementHandle.cs
- HitTestFilterBehavior.cs
- LogicalExpressionTypeConverter.cs
- Variant.cs
- DataGridViewTopLeftHeaderCell.cs
- HandlerFactoryCache.cs
- HttpGetClientProtocol.cs
- DispatchChannelSink.cs
- GenericTypeParameterBuilder.cs
- KeyFrames.cs
- Matrix3D.cs
- SqlBulkCopyColumnMappingCollection.cs
- DropTarget.cs
- XmlComment.cs
- VectorConverter.cs
- InkPresenterAutomationPeer.cs
- DataTableMappingCollection.cs
- TogglePattern.cs
- BaseResourcesBuildProvider.cs
- MaskInputRejectedEventArgs.cs
- HotSpot.cs
- ProfileGroupSettings.cs
- SystemEvents.cs
- PersonalizationEntry.cs
- UIElement3DAutomationPeer.cs
- UnicodeEncoding.cs
- ArithmeticException.cs
- DefaultSerializationProviderAttribute.cs
- InheritanceContextHelper.cs
- XsdDuration.cs
- SocketCache.cs
- SuppressIldasmAttribute.cs
- CodeDirectiveCollection.cs
- HtmlElement.cs
- DesignOnlyAttribute.cs
- NavigationExpr.cs
- TreeView.cs
- ClonableStack.cs
- Content.cs
- XmlEntityReference.cs
- DataGrid.cs
- Classification.cs
- GlobalId.cs
- XslAstAnalyzer.cs
- ArrayTypeMismatchException.cs
- XsltCompileContext.cs
- DynamicMethod.cs