Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / KeyValueInternalCollection.cs / 1305376 / 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
- ColumnPropertiesGroup.cs
- ObjectHandle.cs
- CultureInfoConverter.cs
- _ScatterGatherBuffers.cs
- OperationAbortedException.cs
- Content.cs
- OrthographicCamera.cs
- ProviderCollection.cs
- input.cs
- ToolStripItemImageRenderEventArgs.cs
- HttpRuntimeSection.cs
- RequestCachePolicyConverter.cs
- QueryableFilterUserControl.cs
- ObjectResult.cs
- QilScopedVisitor.cs
- BitmapVisualManager.cs
- PointF.cs
- OleDbException.cs
- DbExpressionVisitor.cs
- _NtlmClient.cs
- TimersDescriptionAttribute.cs
- ActivityBuilderHelper.cs
- XmlCharCheckingReader.cs
- EntryPointNotFoundException.cs
- printdlgexmarshaler.cs
- ComplexTypeEmitter.cs
- EmptyStringExpandableObjectConverter.cs
- XmlDocumentFieldSchema.cs
- Constraint.cs
- PngBitmapEncoder.cs
- RenderData.cs
- TextTreeUndo.cs
- TextEditorCopyPaste.cs
- EventProxy.cs
- SmtpNtlmAuthenticationModule.cs
- RestHandler.cs
- ComplexObject.cs
- RangeValuePatternIdentifiers.cs
- ButtonFlatAdapter.cs
- MonikerProxyAttribute.cs
- WebPartZone.cs
- WebPartMenu.cs
- PerformanceCounterPermissionEntry.cs
- DefaultPropertyAttribute.cs
- FileDialogCustomPlacesCollection.cs
- DiscoveryServiceExtension.cs
- DataGridViewCellStyle.cs
- Clipboard.cs
- CheckBoxRenderer.cs
- TemplateColumn.cs
- DefaultObjectMappingItemCollection.cs
- WebPartDisplayModeEventArgs.cs
- Guid.cs
- ListBox.cs
- ApplicationCommands.cs
- SQLCharsStorage.cs
- DecimalAverageAggregationOperator.cs
- ProcessThread.cs
- CultureTable.cs
- XmlEntity.cs
- DropTarget.cs
- RSAPKCS1SignatureFormatter.cs
- CompilationLock.cs
- FastEncoderWindow.cs
- Crc32.cs
- AccessText.cs
- NavigationWindow.cs
- CompositeControlDesigner.cs
- Control.cs
- BitArray.cs
- AutoResizedEvent.cs
- BinaryFormatterWriter.cs
- DataTableReaderListener.cs
- AttributeProviderAttribute.cs
- CommandConverter.cs
- SpellerStatusTable.cs
- SpeechAudioFormatInfo.cs
- DeploymentExceptionMapper.cs
- ChannelCacheDefaults.cs
- PersonalizationProviderHelper.cs
- VScrollBar.cs
- FontUnit.cs
- LiteralControl.cs
- SHA1.cs
- HostProtectionException.cs
- TableDetailsRow.cs
- WebEvents.cs
- AspNetSynchronizationContext.cs
- EditorZone.cs
- SecurityResources.cs
- ControlEvent.cs
- MSAAWinEventWrap.cs
- LinkLabelLinkClickedEvent.cs
- PageMediaType.cs
- OrderedDictionary.cs
- PageThemeCodeDomTreeGenerator.cs
- HMACMD5.cs
- Hyperlink.cs
- DataGridItemEventArgs.cs
- TiffBitmapEncoder.cs