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
- SQLSingleStorage.cs
- DataGridViewRowCancelEventArgs.cs
- OdbcConnectionString.cs
- ProviderConnectionPointCollection.cs
- InputProcessorProfilesLoader.cs
- DataServiceConfiguration.cs
- QuerySubExprEliminator.cs
- HttpHandlersSection.cs
- ContextMenu.cs
- DocumentDesigner.cs
- WindowsRegion.cs
- DataPagerField.cs
- SortedList.cs
- CodeVariableDeclarationStatement.cs
- DataGridViewColumn.cs
- AssertSection.cs
- PathFigureCollectionValueSerializer.cs
- CodeNamespaceImportCollection.cs
- ProjectionCamera.cs
- ManualResetEvent.cs
- Pipe.cs
- Boolean.cs
- PointKeyFrameCollection.cs
- ColorIndependentAnimationStorage.cs
- Misc.cs
- cookieexception.cs
- LoginCancelEventArgs.cs
- AdPostCacheSubstitution.cs
- RTLAwareMessageBox.cs
- TextElementEnumerator.cs
- DNS.cs
- PageCanvasSize.cs
- DbProviderSpecificTypePropertyAttribute.cs
- Math.cs
- TransformCollection.cs
- ListDictionaryInternal.cs
- CodeTypeMember.cs
- SerialStream.cs
- IndentedTextWriter.cs
- XmlTextReaderImpl.cs
- EventlogProvider.cs
- ResourceIDHelper.cs
- RectValueSerializer.cs
- CreateUserErrorEventArgs.cs
- WeakRefEnumerator.cs
- DrawingAttributes.cs
- AppDomainManager.cs
- shaper.cs
- SafeThemeHandle.cs
- BooleanProjectedSlot.cs
- TextSelectionHelper.cs
- NumericUpDown.cs
- WindowsGraphics.cs
- QueryOptionExpression.cs
- SafeLocalAllocation.cs
- ComboBox.cs
- DocumentPaginator.cs
- StringReader.cs
- GlobalItem.cs
- ConfigurationStrings.cs
- StructuredCompositeActivityDesigner.cs
- ObjectStateManager.cs
- BooleanProjectedSlot.cs
- RenderDataDrawingContext.cs
- TextBox.cs
- WhitespaceReader.cs
- ToolstripProfessionalRenderer.cs
- PersonalizationStateInfoCollection.cs
- ProviderBase.cs
- StandardCommandToolStripMenuItem.cs
- FloaterParaClient.cs
- KeyValueConfigurationElement.cs
- JapaneseCalendar.cs
- ToolBarTray.cs
- TrackingParameters.cs
- IgnoreSection.cs
- Socket.cs
- TemplateComponentConnector.cs
- WebPartChrome.cs
- CssStyleCollection.cs
- TextEditorTyping.cs
- ListItemConverter.cs
- AttachedAnnotationChangedEventArgs.cs
- AuthenticationModulesSection.cs
- XmlnsDefinitionAttribute.cs
- __ComObject.cs
- RtType.cs
- ConfigurationManagerHelper.cs
- ZipIOCentralDirectoryFileHeader.cs
- TreeNodeEventArgs.cs
- PerformanceCounters.cs
- HtmlGenericControl.cs
- RequestCacheValidator.cs
- CodeAccessPermission.cs
- CodeCompileUnit.cs
- BamlLocalizableResource.cs
- TextTreeNode.cs
- HtmlLinkAdapter.cs
- TemplatedWizardStep.cs
- RotateTransform3D.cs