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
- RC2.cs
- EdmToObjectNamespaceMap.cs
- LinearGradientBrush.cs
- EventProviderClassic.cs
- WindowsRichEdit.cs
- RevocationPoint.cs
- EntityContainerRelationshipSet.cs
- MobileTemplatedControlDesigner.cs
- OuterGlowBitmapEffect.cs
- FigureParaClient.cs
- DataGridViewIntLinkedList.cs
- TableDetailsCollection.cs
- CompositionTarget.cs
- ToolStripContentPanel.cs
- ChangePasswordDesigner.cs
- HitTestWithGeometryDrawingContextWalker.cs
- FtpRequestCacheValidator.cs
- HeaderCollection.cs
- DataGridItem.cs
- RoleManagerEventArgs.cs
- FieldDescriptor.cs
- ExternalFile.cs
- TableCellAutomationPeer.cs
- Color.cs
- EntityClassGenerator.cs
- ContentValidator.cs
- FieldAccessException.cs
- ImportCatalogPart.cs
- BaseCollection.cs
- StringPropertyBuilder.cs
- XpsColorContext.cs
- SHA512.cs
- CollectionBase.cs
- ElementMarkupObject.cs
- SecurityHelper.cs
- WebSysDescriptionAttribute.cs
- WmfPlaceableFileHeader.cs
- ConfigXmlCDataSection.cs
- PolicyException.cs
- ClientScriptManager.cs
- WebPartsPersonalizationAuthorization.cs
- ExternalCalls.cs
- ActivityBindForm.cs
- SecuritySessionFilter.cs
- CodeRegionDirective.cs
- X509Certificate2Collection.cs
- PackageRelationship.cs
- DeferredReference.cs
- ScrollChrome.cs
- GradientStop.cs
- ReferenceConverter.cs
- xml.cs
- PeerDuplexChannel.cs
- SMSvcHost.cs
- ProjectionPruner.cs
- EventLogPermissionAttribute.cs
- BasicSecurityProfileVersion.cs
- CodeSnippetExpression.cs
- DynamicRendererThreadManager.cs
- BamlLocalizationDictionary.cs
- ControlPropertyNameConverter.cs
- DefaultObjectMappingItemCollection.cs
- HierarchicalDataBoundControlAdapter.cs
- ImageIndexConverter.cs
- Vector3DIndependentAnimationStorage.cs
- ToolZone.cs
- DefaultTraceListener.cs
- GridViewUpdateEventArgs.cs
- ServiceHostingEnvironment.cs
- TreeNodeCollectionEditor.cs
- AggregateNode.cs
- _AutoWebProxyScriptHelper.cs
- ClientTarget.cs
- DragEvent.cs
- UriTemplatePathSegment.cs
- SchemaElementLookUpTableEnumerator.cs
- RenderDataDrawingContext.cs
- AutomationIdentifierGuids.cs
- SudsParser.cs
- IPAddress.cs
- ViewValidator.cs
- ExpressionSelection.cs
- XmlAttributes.cs
- Soap12ProtocolReflector.cs
- EventNotify.cs
- FilteredDataSetHelper.cs
- DayRenderEvent.cs
- StylusEventArgs.cs
- TreeNodeBindingCollection.cs
- EnumConverter.cs
- PropertyGridView.cs
- ServerType.cs
- Vector3DAnimationBase.cs
- HitTestWithPointDrawingContextWalker.cs
- DrawingDrawingContext.cs
- Rules.cs
- SoapExtensionTypeElementCollection.cs
- ScalarConstant.cs
- FacetChecker.cs
- DelayedRegex.cs