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
- XsltLoader.cs
- CommonObjectSecurity.cs
- ClientTargetCollection.cs
- EndPoint.cs
- SqlWriter.cs
- SHA1.cs
- EngineSiteSapi.cs
- GroupQuery.cs
- RelationshipEntry.cs
- DataGridGeneralPage.cs
- BuildProvidersCompiler.cs
- IIS7UserPrincipal.cs
- TdsParserStateObject.cs
- InternalResources.cs
- CodeDomConfigurationHandler.cs
- StaticFileHandler.cs
- PrintDialog.cs
- DispatcherBuilder.cs
- TextOnlyOutput.cs
- webbrowsersite.cs
- SqlFactory.cs
- StaticExtension.cs
- HtmlInputReset.cs
- SafeProcessHandle.cs
- PersonalizationEntry.cs
- DefaultSettingsSection.cs
- XmlException.cs
- TriggerActionCollection.cs
- EntitySet.cs
- BindingMAnagerBase.cs
- AnimationClock.cs
- UrlPropertyAttribute.cs
- RangeValueProviderWrapper.cs
- ProgressBarHighlightConverter.cs
- Inline.cs
- panel.cs
- IBuiltInEvidence.cs
- EncoderReplacementFallback.cs
- ModelTreeEnumerator.cs
- Command.cs
- X509IssuerSerialKeyIdentifierClause.cs
- BuildProviderAppliesToAttribute.cs
- Point3DConverter.cs
- XsltQilFactory.cs
- EdmConstants.cs
- ObservableCollection.cs
- Converter.cs
- Matrix.cs
- EventManager.cs
- WebEvents.cs
- DataBindingExpressionBuilder.cs
- _FtpControlStream.cs
- LiteralText.cs
- TreeBuilder.cs
- ConfigurationSectionGroupCollection.cs
- DataGridViewColumnStateChangedEventArgs.cs
- BinaryFormatter.cs
- MissingManifestResourceException.cs
- DataControlLinkButton.cs
- HashAlgorithm.cs
- PropertyCollection.cs
- PropertyRecord.cs
- XmlSchemaValidationException.cs
- RijndaelManaged.cs
- DesignerTransactionCloseEvent.cs
- RSAPKCS1SignatureFormatter.cs
- UIntPtr.cs
- ListViewDeleteEventArgs.cs
- InvokeProviderWrapper.cs
- StylusLogic.cs
- SoapDocumentMethodAttribute.cs
- SchemaAttDef.cs
- TemplatedWizardStep.cs
- EntityDataSourceDataSelectionPanel.cs
- ForwardPositionQuery.cs
- TimeEnumHelper.cs
- TransformCryptoHandle.cs
- DataSourceControl.cs
- ImageSource.cs
- XmlArrayItemAttributes.cs
- DesignerInterfaces.cs
- BinaryObjectWriter.cs
- TreeNodeEventArgs.cs
- OrderedDictionary.cs
- ConfigUtil.cs
- BinaryObjectReader.cs
- IsolationInterop.cs
- sqlmetadatafactory.cs
- GB18030Encoding.cs
- CodeGeneratorOptions.cs
- EditingMode.cs
- Parameter.cs
- Point3DCollectionValueSerializer.cs
- ImageCollectionEditor.cs
- CharEnumerator.cs
- returneventsaver.cs
- ScrollProperties.cs
- HttpCachePolicy.cs
- Interlocked.cs
- ApplicationHost.cs