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
- MonitorWrapper.cs
- ToolStripItemCollection.cs
- SafeHandles.cs
- versioninfo.cs
- LinqDataSourceStatusEventArgs.cs
- SourceFileBuildProvider.cs
- XmlSchemaNotation.cs
- DataGridTableCollection.cs
- WebControlsSection.cs
- LicenseManager.cs
- EmbeddedMailObjectsCollection.cs
- DragEvent.cs
- ConfigurationValue.cs
- MergePropertyDescriptor.cs
- XhtmlBasicValidationSummaryAdapter.cs
- PolicyChain.cs
- PreProcessor.cs
- Int16.cs
- DebugView.cs
- APCustomTypeDescriptor.cs
- ParallelDesigner.xaml.cs
- AlphabeticalEnumConverter.cs
- SpellCheck.cs
- CalendarTable.cs
- XPathConvert.cs
- HierarchicalDataBoundControl.cs
- ExtensionSimplifierMarkupObject.cs
- AspNetHostingPermission.cs
- CompressStream.cs
- EntityViewContainer.cs
- WebPageTraceListener.cs
- Int16Converter.cs
- SynchronizedDisposablePool.cs
- ForeignKeyConstraint.cs
- AssemblyCache.cs
- PresentationSource.cs
- IdentityHolder.cs
- MailDefinitionBodyFileNameEditor.cs
- TextElementEnumerator.cs
- Viewport3DAutomationPeer.cs
- SignatureToken.cs
- ExtendedPropertyCollection.cs
- XmlSchemaAnnotated.cs
- StylusShape.cs
- BindUriHelper.cs
- ProxyGenerator.cs
- CommonDialog.cs
- CryptoApi.cs
- WebResponse.cs
- Documentation.cs
- NetSectionGroup.cs
- XmlReaderSettings.cs
- NetNamedPipeSecurityMode.cs
- QueuePropertyVariants.cs
- HandlerFactoryCache.cs
- CompressEmulationStream.cs
- EventLogPermission.cs
- DataError.cs
- Helpers.cs
- ListChangedEventArgs.cs
- Region.cs
- DataSourceView.cs
- cookieexception.cs
- MultiView.cs
- AutomationFocusChangedEventArgs.cs
- LifetimeServices.cs
- rsa.cs
- StateRuntime.cs
- CapabilitiesAssignment.cs
- DynamicResourceExtensionConverter.cs
- RegularExpressionValidator.cs
- StrokeNode.cs
- StateElementCollection.cs
- WorkflowApplicationAbortedException.cs
- IIS7WorkerRequest.cs
- CompilationRelaxations.cs
- HttpCacheParams.cs
- IncrementalCompileAnalyzer.cs
- HierarchicalDataSourceControl.cs
- ReadOnlyState.cs
- DataSourceDescriptorCollection.cs
- NullableDoubleMinMaxAggregationOperator.cs
- _HeaderInfo.cs
- SafeEventLogWriteHandle.cs
- TreeViewItemAutomationPeer.cs
- TypeNameHelper.cs
- StateInitialization.cs
- ViewManager.cs
- RepeatInfo.cs
- DataGridRelationshipRow.cs
- AnnotationComponentChooser.cs
- SQLByteStorage.cs
- CompilerTypeWithParams.cs
- CultureInfoConverter.cs
- SqlInternalConnectionTds.cs
- Matrix3DConverter.cs
- ConstructorBuilder.cs
- ControlSerializer.cs
- COM2ExtendedUITypeEditor.cs
- ListBox.cs