Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / NameValueConfigurationCollection.cs / 1305376 / NameValueConfigurationCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * ImmutableCollections * * Copyright (c) 2004 Microsoft Corporation */ using System; using System.Collections; using System.Collections.Specialized; using System.Net; using System.Configuration; // // This file contains configuration collections that are used by multiple sections // namespace System.Configuration { [ConfigurationCollection(typeof(NameValueConfigurationElement))] public sealed class NameValueConfigurationCollection : ConfigurationElementCollection { private static ConfigurationPropertyCollection _properties; static NameValueConfigurationCollection() { // Property initialization _properties = new ConfigurationPropertyCollection(); } protected internal override ConfigurationPropertyCollection Properties { get { return _properties; } } // // Constructor // public NameValueConfigurationCollection() { } // // Accessors // public new NameValueConfigurationElement this[string name] { get { return (NameValueConfigurationElement) BaseGet(name); } set { int index = -1; // append by default NameValueConfigurationElement tempElement = (NameValueConfigurationElement) BaseGet(name); if (tempElement != null) { index = BaseIndexOf(tempElement); BaseRemoveAt(index); } BaseAdd(index, value); } } public String[] AllKeys { get { return StringUtil.ObjectArrayToStringArray(BaseGetAllKeys()); } } // // Methods // public void Add(NameValueConfigurationElement nameValue) { BaseAdd(nameValue); } public void Remove(NameValueConfigurationElement nameValue) { if (BaseIndexOf(nameValue) >= 0) BaseRemove(nameValue.Name); } public void Remove(string name) { BaseRemove(name); } public void Clear() { BaseClear(); } protected override ConfigurationElement CreateNewElement() { return new NameValueConfigurationElement(); } protected override object GetElementKey(ConfigurationElement element) { return ((NameValueConfigurationElement)element).Name; } } } // 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
- SqlEnums.cs
- StorageEntityTypeMapping.cs
- PointLightBase.cs
- ProxyGenerationError.cs
- UseAttributeSetsAction.cs
- TextEffect.cs
- TransactionFilter.cs
- FacetDescription.cs
- EventTrigger.cs
- HealthMonitoringSection.cs
- FormsAuthentication.cs
- AdPostCacheSubstitution.cs
- PathFigure.cs
- isolationinterop.cs
- ThemeDictionaryExtension.cs
- Int16KeyFrameCollection.cs
- UInt16Storage.cs
- ActivityCodeDomSerializer.cs
- FormatterServices.cs
- WsrmTraceRecord.cs
- DesignColumn.cs
- HttpBrowserCapabilitiesBase.cs
- __ConsoleStream.cs
- ScriptControlDescriptor.cs
- MruCache.cs
- SimpleRecyclingCache.cs
- WebPartZoneAutoFormat.cs
- ComplexBindingPropertiesAttribute.cs
- CriticalFinalizerObject.cs
- ClientCultureInfo.cs
- CqlParserHelpers.cs
- CharUnicodeInfo.cs
- SymLanguageVendor.cs
- SocketAddress.cs
- CodeNamespaceImport.cs
- UiaCoreProviderApi.cs
- GridItemPattern.cs
- securitycriticaldata.cs
- DigitShape.cs
- XmlValidatingReader.cs
- UnionExpr.cs
- PartitionedStream.cs
- BuildResult.cs
- ProxyGenerator.cs
- LinkClickEvent.cs
- HMAC.cs
- LayoutTableCell.cs
- HyperLinkStyle.cs
- DataGridViewRowStateChangedEventArgs.cs
- FixedSOMElement.cs
- mongolianshape.cs
- CheckedListBox.cs
- TraceRecord.cs
- ActivityExecutorOperation.cs
- GridViewRowPresenterBase.cs
- SHA1.cs
- XamlNamespaceHelper.cs
- CallbackDebugBehavior.cs
- ApplicationSecurityManager.cs
- AsyncStreamReader.cs
- MethodBuilder.cs
- EpmTargetPathSegment.cs
- SchemaImporterExtensionElementCollection.cs
- RenderTargetBitmap.cs
- DockProviderWrapper.cs
- ShaderRenderModeValidation.cs
- TextRenderer.cs
- EntityDataSourceDesigner.cs
- GregorianCalendarHelper.cs
- EventProviderWriter.cs
- SchemaTypeEmitter.cs
- NamespaceInfo.cs
- ProtectedConfiguration.cs
- RegexEditorDialog.cs
- ItemCollectionEditor.cs
- ControlValuePropertyAttribute.cs
- IPCCacheManager.cs
- QilTypeChecker.cs
- DBNull.cs
- UpdatePanelTrigger.cs
- Buffer.cs
- _ShellExpression.cs
- XmlSchemaObjectCollection.cs
- SemanticBasicElement.cs
- ParseChildrenAsPropertiesAttribute.cs
- GlyphCollection.cs
- ProtocolsSection.cs
- FormsAuthentication.cs
- InputBuffer.cs
- CompilerGeneratedAttribute.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- PointHitTestResult.cs
- StylusPoint.cs
- RuleSetDialog.cs
- ChtmlPageAdapter.cs
- PersistenceTypeAttribute.cs
- TypeInitializationException.cs
- PropertyDescriptor.cs
- uribuilder.cs
- InvalidDataException.cs