Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / ndp / fx / src / xsp / System / Web / Extensions / Configuration / ConvertersCollection.cs / 2 / 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.Security.Permissions; using System.Web; using System.Web.Compilation; using System.Web.Resources; using System.Web.Script.Serialization; [ AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), 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; } 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Context.cs
- BaseValidator.cs
- XPathNodeList.cs
- LayoutManager.cs
- RegexCompiler.cs
- DataColumnChangeEvent.cs
- HttpCachePolicy.cs
- FieldAccessException.cs
- WindowsFormsHelpers.cs
- TextProperties.cs
- NativeMethods.cs
- DocumentReference.cs
- TextRenderer.cs
- TaskFormBase.cs
- IgnoreFlushAndCloseStream.cs
- SystemIcons.cs
- PerformanceCounters.cs
- Point.cs
- ExpandoClass.cs
- ActiveXMessageFormatter.cs
- CompositeDispatchFormatter.cs
- PointIndependentAnimationStorage.cs
- FixedBufferAttribute.cs
- Domain.cs
- DictionaryCustomTypeDescriptor.cs
- COM2IDispatchConverter.cs
- DBSchemaTable.cs
- Popup.cs
- CommonDialog.cs
- CookieProtection.cs
- PackUriHelper.cs
- ObjectReferenceStack.cs
- EventLogEntry.cs
- DateTimeUtil.cs
- OracleLob.cs
- FormDocumentDesigner.cs
- MetaChildrenColumn.cs
- GlobalProxySelection.cs
- WebMethodAttribute.cs
- HiddenField.cs
- XMLUtil.cs
- CallbackHandler.cs
- BrowserDefinition.cs
- State.cs
- TemplatedEditableDesignerRegion.cs
- InfoCardBaseException.cs
- URLIdentityPermission.cs
- ListViewItem.cs
- DataServices.cs
- Pens.cs
- Predicate.cs
- dsa.cs
- ReachVisualSerializerAsync.cs
- ColorConverter.cs
- SqlMethodAttribute.cs
- ParamArrayAttribute.cs
- Environment.cs
- ParallelTimeline.cs
- ListenerConnectionDemuxer.cs
- KeyboardDevice.cs
- FixedTextContainer.cs
- SqlRecordBuffer.cs
- SchemaMerger.cs
- ClientScriptManagerWrapper.cs
- WebRequest.cs
- DecimalAnimation.cs
- RepeatBehaviorConverter.cs
- GeometryConverter.cs
- SessionEndingCancelEventArgs.cs
- ImmComposition.cs
- WebSysDescriptionAttribute.cs
- Win32.cs
- SizeF.cs
- TypedLocationWrapper.cs
- MenuItemStyle.cs
- KeyTimeConverter.cs
- WindowsStatusBar.cs
- ApplicationServiceHelper.cs
- AuthenticationConfig.cs
- MetadataItemSerializer.cs
- FastEncoder.cs
- NumericUpDownAccelerationCollection.cs
- SecurityElement.cs
- SizeF.cs
- Dictionary.cs
- QueueProcessor.cs
- SeparatorAutomationPeer.cs
- DecoderReplacementFallback.cs
- SamlAssertionKeyIdentifierClause.cs
- ManualResetEvent.cs
- TextBoxLine.cs
- OleDragDropHandler.cs
- TypeDependencyAttribute.cs
- HttpContext.cs
- RootAction.cs
- MatrixIndependentAnimationStorage.cs
- PanelStyle.cs
- DataGridViewTopRowAccessibleObject.cs
- FileUtil.cs
- AssociationTypeEmitter.cs