Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Configuration / System / Configuration / NameValueConfigurationCollection.cs / 1 / 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. //------------------------------------------------------------------------------ //// 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
- CombinedGeometry.cs
- HttpCookieCollection.cs
- ComponentChangedEvent.cs
- AllMembershipCondition.cs
- ObjectConverter.cs
- QuaternionAnimation.cs
- SearchForVirtualItemEventArgs.cs
- AlphabeticalEnumConverter.cs
- DataGridTable.cs
- FormViewDeleteEventArgs.cs
- PerformanceCounterScope.cs
- EditorPart.cs
- PolicyValidationException.cs
- TraceXPathNavigator.cs
- ToolStripRendererSwitcher.cs
- BamlResourceSerializer.cs
- FileCodeGroup.cs
- TimestampInformation.cs
- ExecutionContext.cs
- ContextStaticAttribute.cs
- FtpWebRequest.cs
- ColumnCollection.cs
- ValueType.cs
- NullRuntimeConfig.cs
- SupportedAddressingMode.cs
- SpellerHighlightLayer.cs
- TableRow.cs
- Button.cs
- InvalidateEvent.cs
- GridToolTip.cs
- SiblingIterators.cs
- ObjectStateManager.cs
- LinkedResourceCollection.cs
- SystemThemeKey.cs
- LineGeometry.cs
- RestrictedTransactionalPackage.cs
- NativeCppClassAttribute.cs
- StringPropertyBuilder.cs
- ListChangedEventArgs.cs
- ExecutionContext.cs
- XmlImplementation.cs
- GeneralTransformGroup.cs
- TableStyle.cs
- _UriTypeConverter.cs
- SelectingProviderEventArgs.cs
- ExcludeFromCodeCoverageAttribute.cs
- RightsManagementSuppressedStream.cs
- PointAnimationClockResource.cs
- NumericPagerField.cs
- ClientSettingsProvider.cs
- ByteRangeDownloader.cs
- SqlXml.cs
- PcmConverter.cs
- CreateCardRequest.cs
- HttpCapabilitiesBase.cs
- DbParameterCollectionHelper.cs
- DbFunctionCommandTree.cs
- Options.cs
- BasicBrowserDialog.cs
- CompressedStack.cs
- XmlReflectionMember.cs
- ActivityBindForm.Designer.cs
- mansign.cs
- RepeaterItemCollection.cs
- ValidateNames.cs
- MetadataFile.cs
- DataGridViewColumnDesigner.cs
- _NTAuthentication.cs
- ThaiBuddhistCalendar.cs
- DBNull.cs
- ThreadStateException.cs
- LinearGradientBrush.cs
- DecoderFallbackWithFailureFlag.cs
- PreservationFileReader.cs
- NativeMethods.cs
- ScriptReference.cs
- NavigationService.cs
- SafeEventLogWriteHandle.cs
- XsdSchemaFileEditor.cs
- cookiecontainer.cs
- ToolStripItemDataObject.cs
- COM2TypeInfoProcessor.cs
- LineSegment.cs
- Visual3D.cs
- FusionWrap.cs
- ProcessProtocolHandler.cs
- ToolStrip.cs
- OLEDB_Util.cs
- CryptoApi.cs
- BaseTreeIterator.cs
- CodePageUtils.cs
- FlowDecision.cs
- SystemIPInterfaceProperties.cs
- TypeDependencyAttribute.cs
- IPPacketInformation.cs
- ViewPort3D.cs
- OrderedEnumerableRowCollection.cs
- SpeechEvent.cs
- OdbcException.cs
- ReadOnlyPropertyMetadata.cs