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
- TextBoxAutoCompleteSourceConverter.cs
- SqlTransaction.cs
- StateMachineWorkflowInstance.cs
- PageScaling.cs
- ScrollBarRenderer.cs
- DefaultPrintController.cs
- BufferCache.cs
- XhtmlBasicTextBoxAdapter.cs
- CngUIPolicy.cs
- ToolStripPanelDesigner.cs
- UriSectionReader.cs
- RMEnrollmentPage1.cs
- MonthChangedEventArgs.cs
- MatrixAnimationUsingPath.cs
- DialogBaseForm.cs
- CodeCatchClauseCollection.cs
- Ppl.cs
- TextTabProperties.cs
- CompareValidator.cs
- XmlSchemaNotation.cs
- AssemblyBuilder.cs
- ExpressionBuilderCollection.cs
- UnsafeNativeMethodsCLR.cs
- WebBrowserUriTypeConverter.cs
- ViewValidator.cs
- CombinedGeometry.cs
- Graphics.cs
- ActivityBindForm.cs
- RSAPKCS1SignatureFormatter.cs
- WbmpConverter.cs
- Font.cs
- StoragePropertyMapping.cs
- OraclePermission.cs
- StringFreezingAttribute.cs
- ColorAnimationBase.cs
- MappingSource.cs
- WebPartVerbCollection.cs
- QueryOutputWriter.cs
- AppDomainProtocolHandler.cs
- ASCIIEncoding.cs
- ControlValuePropertyAttribute.cs
- SqlException.cs
- Viewport3DVisual.cs
- RecordsAffectedEventArgs.cs
- InvalidDataException.cs
- ToolboxItem.cs
- EntityReference.cs
- BooleanConverter.cs
- FactoryGenerator.cs
- UpdateManifestForBrowserApplication.cs
- ServiceContractAttribute.cs
- TripleDES.cs
- XmlQualifiedNameTest.cs
- ViewLoader.cs
- CancelEventArgs.cs
- TreeNodeMouseHoverEvent.cs
- HotSpotCollection.cs
- SrgsText.cs
- TemplatedMailWebEventProvider.cs
- CodeAssignStatement.cs
- BufferedGraphicsManager.cs
- MessageQueueCriteria.cs
- HostedTcpTransportManager.cs
- GridViewCancelEditEventArgs.cs
- PathTooLongException.cs
- LogConverter.cs
- FrameworkObject.cs
- CacheDependency.cs
- InlineCategoriesDocument.cs
- DictionaryChange.cs
- AstTree.cs
- Stream.cs
- XmlBuffer.cs
- CopyNodeSetAction.cs
- PartialTrustHelpers.cs
- HandlerFactoryCache.cs
- LZCodec.cs
- XhtmlBasicTextBoxAdapter.cs
- WindowsListViewItemStartMenu.cs
- StringInfo.cs
- RequestBringIntoViewEventArgs.cs
- TreeNodeStyleCollection.cs
- x509utils.cs
- ConfigXmlElement.cs
- ReadOnlyDictionary.cs
- EdmFunction.cs
- log.cs
- StyleCollection.cs
- MinimizableAttributeTypeConverter.cs
- ColorInterpolationModeValidation.cs
- ManagementEventWatcher.cs
- ConnectionPoint.cs
- AuthenticationException.cs
- BlockExpression.cs
- TypeFieldSchema.cs
- ArraySubsetEnumerator.cs
- JsonByteArrayDataContract.cs
- MemberExpressionHelper.cs
- LinkedResource.cs
- ScriptingScriptResourceHandlerSection.cs