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
- SqlDeflator.cs
- CodeMemberMethod.cs
- WebPartChrome.cs
- StateManagedCollection.cs
- SqlDataSourceView.cs
- TableCellCollection.cs
- DSASignatureDeformatter.cs
- MouseActionConverter.cs
- SapiAttributeParser.cs
- RecommendedAsConfigurableAttribute.cs
- OrCondition.cs
- AttributeQuery.cs
- Span.cs
- ExtensionSimplifierMarkupObject.cs
- X509ChainElement.cs
- ResourceDisplayNameAttribute.cs
- MimeObjectFactory.cs
- DockPatternIdentifiers.cs
- XmlEnumAttribute.cs
- AuthStoreRoleProvider.cs
- UriExt.cs
- GroupBoxDesigner.cs
- EventLogSession.cs
- OneWayChannelListener.cs
- AppearanceEditorPart.cs
- TypefaceMetricsCache.cs
- DataGridViewLinkColumn.cs
- XmlElementAttribute.cs
- _UriTypeConverter.cs
- XmlNotation.cs
- DocumentPage.cs
- _NtlmClient.cs
- Timer.cs
- FromReply.cs
- MessageQueuePermissionEntry.cs
- PhysicalFontFamily.cs
- EntityKey.cs
- ScriptResourceHandler.cs
- _NtlmClient.cs
- TriggerAction.cs
- Error.cs
- DESCryptoServiceProvider.cs
- ServiceInfo.cs
- SubqueryRules.cs
- TemplateControlBuildProvider.cs
- LexicalChunk.cs
- Quaternion.cs
- GlobalEventManager.cs
- MsdtcClusterUtils.cs
- ComponentRenameEvent.cs
- SharedUtils.cs
- SourceInterpreter.cs
- FontStretch.cs
- CorrelationTokenInvalidatedHandler.cs
- DataTrigger.cs
- ResourceExpression.cs
- EdmMember.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- Listbox.cs
- XPathChildIterator.cs
- Pair.cs
- TimeoutValidationAttribute.cs
- ValueTable.cs
- SafeLocalMemHandle.cs
- WebPartDeleteVerb.cs
- storepermissionattribute.cs
- SolidColorBrush.cs
- EditorPartChrome.cs
- ProxyManager.cs
- GridViewRowCollection.cs
- SecurityDescriptor.cs
- WorkflowViewElement.cs
- DelayedRegex.cs
- XmlLoader.cs
- ToolStripDropDownItem.cs
- FlowDocumentPageViewerAutomationPeer.cs
- DbConnectionHelper.cs
- MailDefinition.cs
- TextElementEnumerator.cs
- ModifierKeysValueSerializer.cs
- PageTheme.cs
- DataSet.cs
- UnsafeNativeMethods.cs
- ProfileServiceManager.cs
- DiscoveryProxy.cs
- TriggerAction.cs
- PrimitiveList.cs
- BufferBuilder.cs
- RenderCapability.cs
- ResourceDictionaryCollection.cs
- IOException.cs
- DocumentViewerAutomationPeer.cs
- ErrorTableItemStyle.cs
- COM2PropertyBuilderUITypeEditor.cs
- TextLineBreak.cs
- XmlAttributeProperties.cs
- Guid.cs
- CancellationToken.cs
- PowerEase.cs
- DirectionalLight.cs