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
- TableLayoutStyleCollection.cs
- SchemaElementDecl.cs
- JournalNavigationScope.cs
- PlacementWorkspace.cs
- BlurBitmapEffect.cs
- VolatileResourceManager.cs
- SurrogateEncoder.cs
- GlyphRunDrawing.cs
- DataGridViewIntLinkedList.cs
- SafeArrayTypeMismatchException.cs
- SubclassTypeValidator.cs
- BinaryFormatterWriter.cs
- FormsAuthenticationTicket.cs
- OracleConnectionFactory.cs
- ColorMap.cs
- XmlIlTypeHelper.cs
- Validator.cs
- ObjectStorage.cs
- SecurityCriticalDataForSet.cs
- OdbcRowUpdatingEvent.cs
- PeerTransportListenAddressValidatorAttribute.cs
- WmlValidatorAdapter.cs
- SmtpMail.cs
- HtmlLink.cs
- ValidationUtility.cs
- HostedHttpRequestAsyncResult.cs
- ErrorWrapper.cs
- DataDocumentXPathNavigator.cs
- DurableEnlistmentState.cs
- RayHitTestParameters.cs
- Part.cs
- SQLCharsStorage.cs
- OSEnvironmentHelper.cs
- ToolStripCustomTypeDescriptor.cs
- xmlglyphRunInfo.cs
- Int32CollectionConverter.cs
- XmlSchemaAppInfo.cs
- SimpleType.cs
- VisualStyleTypesAndProperties.cs
- SystemWebSectionGroup.cs
- AutoGeneratedFieldProperties.cs
- HostProtectionPermission.cs
- CaseStatement.cs
- MetadataArtifactLoader.cs
- NavigationEventArgs.cs
- BaseCollection.cs
- DbProviderFactories.cs
- XmlUtf8RawTextWriter.cs
- FrameworkContextData.cs
- _BufferOffsetSize.cs
- WhitespaceReader.cs
- ProfilePropertyNameValidator.cs
- SymDocumentType.cs
- UriParserTemplates.cs
- Scene3D.cs
- PolicyReader.cs
- VectorAnimationUsingKeyFrames.cs
- ResourceSet.cs
- Knowncolors.cs
- ComNativeDescriptor.cs
- X500Name.cs
- TextLineBreak.cs
- KeyTimeConverter.cs
- SafeThemeHandle.cs
- ContractCodeDomInfo.cs
- XmlDownloadManager.cs
- FormsAuthenticationEventArgs.cs
- IdentityVerifier.cs
- RichTextBoxAutomationPeer.cs
- WinInetCache.cs
- DataSetUtil.cs
- SourceSwitch.cs
- PackageProperties.cs
- TTSVoice.cs
- _AutoWebProxyScriptEngine.cs
- MouseBinding.cs
- XmlLanguageConverter.cs
- XmlSchemaChoice.cs
- CreateParams.cs
- Properties.cs
- FunctionOverloadResolver.cs
- SchemaEntity.cs
- ViewgenContext.cs
- SqlBuffer.cs
- UserControlParser.cs
- _WebProxyDataBuilder.cs
- EdmTypeAttribute.cs
- ObjectDisposedException.cs
- ToolStripGripRenderEventArgs.cs
- DependencyPropertyDescriptor.cs
- EditCommandColumn.cs
- RequestCacheEntry.cs
- WebPartsSection.cs
- RequestFactory.cs
- MimeMapping.cs
- OleDbErrorCollection.cs
- XamlRtfConverter.cs
- CodeTypeDeclarationCollection.cs
- ValidatorCompatibilityHelper.cs
- EqualityComparer.cs