Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DeflateStream.cs
- SmtpCommands.cs
- X500Name.cs
- ResourceDescriptionAttribute.cs
- ComponentCache.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- InputEventArgs.cs
- XNameTypeConverter.cs
- COM2TypeInfoProcessor.cs
- SqlExpressionNullability.cs
- ToolStripComboBox.cs
- DataTableClearEvent.cs
- EnumerationRangeValidationUtil.cs
- WarningException.cs
- SoapSchemaImporter.cs
- ToolStripItemImageRenderEventArgs.cs
- _ConnectStream.cs
- DataGridViewCellValueEventArgs.cs
- BoundsDrawingContextWalker.cs
- UInt32Converter.cs
- CompositeActivityTypeDescriptorProvider.cs
- AutomationPatternInfo.cs
- exports.cs
- BaseTemplatedMobileComponentEditor.cs
- IHttpResponseInternal.cs
- RequestUriProcessor.cs
- LongValidator.cs
- StrokeFIndices.cs
- ListViewGroupConverter.cs
- PropertyGeneratedEventArgs.cs
- GroupItemAutomationPeer.cs
- PropertySegmentSerializationProvider.cs
- TextElementEditingBehaviorAttribute.cs
- CustomTypeDescriptor.cs
- TextWriter.cs
- IImplicitResourceProvider.cs
- InheritedPropertyChangedEventArgs.cs
- WebPartTracker.cs
- RuleSettings.cs
- LambdaExpression.cs
- FontSizeConverter.cs
- CacheMemory.cs
- Switch.cs
- StrongNameKeyPair.cs
- MenuEventArgs.cs
- ChildrenQuery.cs
- TypeUtil.cs
- ValidatorCollection.cs
- RtfToken.cs
- ApplicationDirectoryMembershipCondition.cs
- SpellerError.cs
- DecimalAnimationUsingKeyFrames.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- HttpWriter.cs
- AggregateNode.cs
- DataGridAddNewRow.cs
- ResourceWriter.cs
- SubpageParagraph.cs
- ColorConverter.cs
- SelectedGridItemChangedEvent.cs
- SynchronizingStream.cs
- ToolStripPanelCell.cs
- TemplateNameScope.cs
- AttributeAction.cs
- HttpApplicationFactory.cs
- HelpOperationInvoker.cs
- XmlSchemaSimpleType.cs
- RegistrationServices.cs
- mactripleDES.cs
- ContainerControlDesigner.cs
- PeerNameRegistration.cs
- StatusBarItem.cs
- XmlSortKey.cs
- CompilerTypeWithParams.cs
- Duration.cs
- FixedPosition.cs
- DbReferenceCollection.cs
- LightweightCodeGenerator.cs
- AppSettingsSection.cs
- WindowsIPAddress.cs
- XPathEmptyIterator.cs
- OracleConnectionFactory.cs
- ToolTip.cs
- WSFederationHttpSecurity.cs
- ContextConfiguration.cs
- PeerSecurityManager.cs
- SqlStatistics.cs
- NativeMethods.cs
- AutomationAttributeInfo.cs
- Inflater.cs
- ValidationHelpers.cs
- DataGridViewCellCollection.cs
- HtmlValidatorAdapter.cs
- BamlLocalizationDictionary.cs
- Decoder.cs
- ConfigXmlAttribute.cs
- RequestStatusBarUpdateEventArgs.cs
- Errors.cs
- DefaultValueAttribute.cs
- LongValidator.cs