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
- TableLayoutSettingsTypeConverter.cs
- TraceHandlerErrorFormatter.cs
- DesignSurfaceCollection.cs
- StatusBarPanel.cs
- COM2ComponentEditor.cs
- Metafile.cs
- CompilationLock.cs
- XmlStreamStore.cs
- Queue.cs
- RequestReplyCorrelator.cs
- TransactionScope.cs
- OdbcCommand.cs
- ProgramNode.cs
- StylusPointPropertyInfoDefaults.cs
- WindowHideOrCloseTracker.cs
- ServiceDiscoveryBehavior.cs
- ByteStack.cs
- PropagatorResult.cs
- RawStylusInputCustomDataList.cs
- ColumnResizeUndoUnit.cs
- DisposableCollectionWrapper.cs
- ExceptionHelpers.cs
- PersonalizationStateInfoCollection.cs
- EpmContentSerializerBase.cs
- BasicHttpSecurityMode.cs
- XmlUtil.cs
- WebBrowserNavigatingEventHandler.cs
- ExpressionBindings.cs
- PolicyAssertionCollection.cs
- EntityDataSourceWizardForm.cs
- RelatedView.cs
- EnumerableWrapperWeakToStrong.cs
- DefaultAsyncDataDispatcher.cs
- ExtensionFile.cs
- Root.cs
- Latin1Encoding.cs
- SignedPkcs7.cs
- BamlLocalizableResourceKey.cs
- ExpressionEditorAttribute.cs
- HandleCollector.cs
- DataTableClearEvent.cs
- SecurityManager.cs
- EditingMode.cs
- OpenTypeCommon.cs
- Environment.cs
- WriterOutput.cs
- ComponentDispatcherThread.cs
- RecordConverter.cs
- DynamicActivityTypeDescriptor.cs
- AutomationPeer.cs
- SqlMethodAttribute.cs
- DataObjectMethodAttribute.cs
- DragCompletedEventArgs.cs
- DiscreteKeyFrames.cs
- TextTrailingWordEllipsis.cs
- BuildResult.cs
- ToolStripDropDownMenu.cs
- ToolStripTextBox.cs
- MailHeaderInfo.cs
- _LazyAsyncResult.cs
- XPathAncestorQuery.cs
- DigitShape.cs
- ResourcesGenerator.cs
- MouseCaptureWithinProperty.cs
- DataGridViewAdvancedBorderStyle.cs
- COM2IDispatchConverter.cs
- EdmToObjectNamespaceMap.cs
- SolidColorBrush.cs
- PostBackOptions.cs
- SecurityDescriptor.cs
- ApplicationServicesHostFactory.cs
- TileBrush.cs
- MILUtilities.cs
- Model3D.cs
- ConfigurationStrings.cs
- InstallerTypeAttribute.cs
- BufferedStream2.cs
- TextElementCollection.cs
- ServiceDesigner.cs
- PeerCredential.cs
- MarkedHighlightComponent.cs
- Grant.cs
- StringComparer.cs
- AccessText.cs
- WeakHashtable.cs
- XhtmlConformanceSection.cs
- DropShadowBitmapEffect.cs
- QueryConverter.cs
- XmlTextWriter.cs
- OdbcInfoMessageEvent.cs
- CqlLexerHelpers.cs
- safex509handles.cs
- TreeNodeMouseHoverEvent.cs
- UnitySerializationHolder.cs
- TypeSource.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- TextDecorationCollection.cs
- StylusPlugInCollection.cs
- GridViewColumnHeaderAutomationPeer.cs
- DbConnectionPoolOptions.cs