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
- UiaCoreTypesApi.cs
- AudienceUriMode.cs
- TextModifier.cs
- WebEventTraceProvider.cs
- DataTableReaderListener.cs
- X509Certificate2Collection.cs
- ContextMarshalException.cs
- CurrencyWrapper.cs
- XmlReaderSettings.cs
- DelegateArgument.cs
- SqlServer2KCompatibilityAnnotation.cs
- FileUpload.cs
- RegistryPermission.cs
- SqlBulkCopy.cs
- WaveHeader.cs
- TCEAdapterGenerator.cs
- KerberosSecurityTokenParameters.cs
- StateWorkerRequest.cs
- FontWeights.cs
- PolicyManager.cs
- ObjectParameterCollection.cs
- PreservationFileReader.cs
- NewArrayExpression.cs
- AuthenticationModulesSection.cs
- ContentPropertyAttribute.cs
- AssociatedControlConverter.cs
- FormViewRow.cs
- _LocalDataStoreMgr.cs
- XmlSchemaComplexContent.cs
- MethodBody.cs
- IItemProperties.cs
- PrivilegeNotHeldException.cs
- DiscoveryReferences.cs
- GridViewItemAutomationPeer.cs
- BooleanStorage.cs
- NaturalLanguageHyphenator.cs
- WebControl.cs
- EdmSchemaError.cs
- DataGridLinkButton.cs
- DataTableNewRowEvent.cs
- Scene3D.cs
- DictionaryMarkupSerializer.cs
- XmlSchemaInfo.cs
- FieldNameLookup.cs
- PropertyEmitterBase.cs
- PrintController.cs
- MediaTimeline.cs
- EntityCommand.cs
- SiteMapNodeItemEventArgs.cs
- DataServiceQueryOfT.cs
- ResourceReader.cs
- PageAsyncTask.cs
- QilVisitor.cs
- PrintPreviewGraphics.cs
- BitmapMetadata.cs
- HitTestParameters.cs
- ZoomPercentageConverter.cs
- DropTarget.cs
- ToolStripArrowRenderEventArgs.cs
- SQLUtility.cs
- XmlWriter.cs
- XXXInfos.cs
- OdbcErrorCollection.cs
- GridProviderWrapper.cs
- WindowsFormsLinkLabel.cs
- Size.cs
- ViewStateAttachedPropertyFeature.cs
- ModifiableIteratorCollection.cs
- CqlGenerator.cs
- BinaryExpression.cs
- DataDesignUtil.cs
- Profiler.cs
- KeyValueSerializer.cs
- MetadataCollection.cs
- WsatTransactionInfo.cs
- BasePropertyDescriptor.cs
- ChannelParameterCollection.cs
- XpsPartBase.cs
- ServiceHttpHandlerFactory.cs
- XamlTypeMapper.cs
- LocationReference.cs
- ThousandthOfEmRealPoints.cs
- XsltContext.cs
- CodeAttributeDeclaration.cs
- _NestedMultipleAsyncResult.cs
- DataGridBeginningEditEventArgs.cs
- DataBoundControl.cs
- StateMachineAction.cs
- PrimaryKeyTypeConverter.cs
- StrokeCollectionConverter.cs
- WebResourceAttribute.cs
- GradientBrush.cs
- Permission.cs
- ContentAlignmentEditor.cs
- Main.cs
- FormatterServices.cs
- Wildcard.cs
- WebEventCodes.cs
- CompositeFontInfo.cs
- AmbientLight.cs