Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Configuration / System / Configuration / KeyValueInternalCollection.cs / 1 / KeyValueInternalCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; // class AppSettingsSection class KeyValueInternalCollection : NameValueCollection { private AppSettingsSection _root = null; public KeyValueInternalCollection(AppSettingsSection root) { _root = root; foreach (KeyValueConfigurationElement element in _root.Settings) { base.Add(element.Key, element.Value); } } public override void Add(String key, String value) { _root.Settings.Add(new KeyValueConfigurationElement(key, value)); base.Add(key, value); } public override void Clear() { _root.Settings.Clear(); base.Clear(); } public override void Remove(string key) { _root.Settings.Remove(key); base.Remove(key); } #if DONT_COMPILE // Unfortunately this is not virtual and we hand out the base collection public new string this[string key] { get { return base[key]; } set { _root.Settings[key] = new KeyValueConfigurationElement(key, value); base[key] = value; } } #endif } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; // class AppSettingsSection class KeyValueInternalCollection : NameValueCollection { private AppSettingsSection _root = null; public KeyValueInternalCollection(AppSettingsSection root) { _root = root; foreach (KeyValueConfigurationElement element in _root.Settings) { base.Add(element.Key, element.Value); } } public override void Add(String key, String value) { _root.Settings.Add(new KeyValueConfigurationElement(key, value)); base.Add(key, value); } public override void Clear() { _root.Settings.Clear(); base.Clear(); } public override void Remove(string key) { _root.Settings.Remove(key); base.Remove(key); } #if DONT_COMPILE // Unfortunately this is not virtual and we hand out the base collection public new string this[string key] { get { return base[key]; } set { _root.Settings[key] = new KeyValueConfigurationElement(key, value); base[key] = value; } } #endif } } // 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
- DetailsViewActionList.cs
- ImportException.cs
- MultiTrigger.cs
- MeasurementDCInfo.cs
- DesignerAdapterAttribute.cs
- ConnectionOrientedTransportManager.cs
- FunctionCommandText.cs
- ListItemParagraph.cs
- SourceLineInfo.cs
- AssemblyName.cs
- SqlException.cs
- HttpConfigurationSystem.cs
- ListViewDeletedEventArgs.cs
- LateBoundChannelParameterCollection.cs
- DoubleMinMaxAggregationOperator.cs
- XamlTypeWithExplicitNamespace.cs
- LineInfo.cs
- MarshalByValueComponent.cs
- CodePageEncoding.cs
- ImageList.cs
- NativeMethodsCLR.cs
- SearchForVirtualItemEventArgs.cs
- TracedNativeMethods.cs
- CustomAttributeFormatException.cs
- XsdDateTime.cs
- RelationshipManager.cs
- ProjectionPathBuilder.cs
- FontSource.cs
- DataGridGeneralPage.cs
- ToolBar.cs
- Win32SafeHandles.cs
- PublishLicense.cs
- ConnectorSelectionGlyph.cs
- ScrollProperties.cs
- WebCodeGenerator.cs
- MsiStyleLogWriter.cs
- RtfToken.cs
- StructuredProperty.cs
- CodeRegionDirective.cs
- DataMemberConverter.cs
- RegexBoyerMoore.cs
- SqlEnums.cs
- unsafeIndexingFilterStream.cs
- ImageConverter.cs
- InteropTrackingRecord.cs
- CheckBoxField.cs
- DragEventArgs.cs
- LinearGradientBrush.cs
- ArrayHelper.cs
- TraceLevelStore.cs
- BasePattern.cs
- PolicyLevel.cs
- StoreConnection.cs
- QueryGenerator.cs
- FontConverter.cs
- BindStream.cs
- CommandLineParser.cs
- SchemaCreator.cs
- QilStrConcat.cs
- ConditionalBranch.cs
- Vector3DCollectionConverter.cs
- QilReference.cs
- IxmlLineInfo.cs
- DataObjectAttribute.cs
- ErrorProvider.cs
- XmlAnyAttributeAttribute.cs
- SQLInt16.cs
- ComplusTypeValidator.cs
- IriParsingElement.cs
- StateValidator.cs
- UriScheme.cs
- connectionpool.cs
- HttpResponseBase.cs
- DataTableTypeConverter.cs
- ReaderWriterLockSlim.cs
- MbpInfo.cs
- MissingMemberException.cs
- Dynamic.cs
- CreateCardRequest.cs
- RoleService.cs
- DeviceContexts.cs
- ListControl.cs
- BinHexDecoder.cs
- HtmlFormWrapper.cs
- ConstructorExpr.cs
- SafeReversePInvokeHandle.cs
- ErrorWebPart.cs
- SqlNotificationRequest.cs
- DoubleAnimationBase.cs
- RegexCode.cs
- ProfileSettings.cs
- CalendarDesigner.cs
- _Rfc2616CacheValidators.cs
- MessageContractMemberAttribute.cs
- StyleXamlParser.cs
- FtpCachePolicyElement.cs
- DelegatingConfigHost.cs
- TypeListConverter.cs
- Utils.cs
- WindowAutomationPeer.cs