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 / 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
- DriveInfo.cs
- ProjectedWrapper.cs
- SynchronizationContext.cs
- ReferenceConverter.cs
- OperationFormatUse.cs
- OutputScopeManager.cs
- SchemaTypeEmitter.cs
- Matrix.cs
- DataSourceSelectArguments.cs
- RotateTransform.cs
- SqlConnection.cs
- Fonts.cs
- DownloadProgressEventArgs.cs
- DataGridViewColumnTypeEditor.cs
- DataGridItemCollection.cs
- ToolStripMenuItem.cs
- InputMethodStateChangeEventArgs.cs
- TemplatedMailWebEventProvider.cs
- ResourcesGenerator.cs
- ProxySimple.cs
- XXXInfos.cs
- ControlPropertyNameConverter.cs
- CompilerGeneratedAttribute.cs
- FlowDocument.cs
- ObjectDisposedException.cs
- SqlCommand.cs
- UInt32.cs
- _ProxyChain.cs
- ScriptDescriptor.cs
- DockPanel.cs
- RegistrySecurity.cs
- DeleteHelper.cs
- ExpressionParser.cs
- XsdBuilder.cs
- ArgumentsParser.cs
- StructuredCompositeActivityDesigner.cs
- SafeCryptContextHandle.cs
- XmlSchemaObject.cs
- MsmqIntegrationMessageProperty.cs
- FullTextBreakpoint.cs
- WorkflowApplicationIdleEventArgs.cs
- TickBar.cs
- ThicknessAnimationBase.cs
- FixedTextView.cs
- SafeCryptoHandles.cs
- JavaScriptSerializer.cs
- XmlBaseReader.cs
- RegistryConfigurationProvider.cs
- PaperSize.cs
- TextServicesCompartmentContext.cs
- SQLChars.cs
- ListManagerBindingsCollection.cs
- SelectedDatesCollection.cs
- PageEventArgs.cs
- XmlWrappingReader.cs
- XmlQueryCardinality.cs
- WebBrowserContainer.cs
- XmlnsCache.cs
- PrivacyNoticeBindingElement.cs
- CryptographicAttribute.cs
- ObservableCollection.cs
- ObjectContext.cs
- ProjectedSlot.cs
- AddingNewEventArgs.cs
- ViewCellSlot.cs
- TimerEventSubscriptionCollection.cs
- SafeLibraryHandle.cs
- ConnectionInterfaceCollection.cs
- ReadOnlyCollection.cs
- WebProxyScriptElement.cs
- TaskHelper.cs
- OrthographicCamera.cs
- diagnosticsswitches.cs
- CheckableControlBaseAdapter.cs
- ContainerControl.cs
- DesignerView.cs
- NeutralResourcesLanguageAttribute.cs
- InputLanguageSource.cs
- DispatcherTimer.cs
- MediaElement.cs
- BamlRecordHelper.cs
- FlowchartSizeFeature.cs
- MexNamedPipeBindingElement.cs
- PointLightBase.cs
- ValueTypeIndexerReference.cs
- Overlapped.cs
- DesignRelationCollection.cs
- DiscriminatorMap.cs
- MemberBinding.cs
- OraclePermission.cs
- CounterNameConverter.cs
- EdmConstants.cs
- _AcceptOverlappedAsyncResult.cs
- Selection.cs
- GAC.cs
- CodeFieldReferenceExpression.cs
- TextRange.cs
- XmlIlVisitor.cs
- PluralizationService.cs
- COM2ComponentEditor.cs