Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- NameValueConfigurationCollection.cs
- PaintEvent.cs
- IntSecurity.cs
- DataPointer.cs
- Matrix.cs
- CardSpacePolicyElement.cs
- BypassElementCollection.cs
- RuntimeUtils.cs
- ApplicationSettingsBase.cs
- DataSourceHelper.cs
- PropertyEmitter.cs
- UrlMappingsModule.cs
- RtfFormatStack.cs
- StrokeIntersection.cs
- Win32.cs
- SelectionService.cs
- PageCatalogPart.cs
- IResourceProvider.cs
- PagedDataSource.cs
- InfoCardArgumentException.cs
- StringArrayConverter.cs
- OptimizerPatterns.cs
- RoutedPropertyChangedEventArgs.cs
- Encoding.cs
- ArraySet.cs
- LoadedEvent.cs
- StrongNameMembershipCondition.cs
- InvokeCompletedEventArgs.cs
- NativeMethods.cs
- DoubleUtil.cs
- ConstructorBuilder.cs
- DataTemplateKey.cs
- DbConnectionOptions.cs
- XmlTextAttribute.cs
- TableLayoutPanelBehavior.cs
- ProcessHostFactoryHelper.cs
- HtmlForm.cs
- BitmapPalettes.cs
- querybuilder.cs
- TextHidden.cs
- SerialPinChanges.cs
- AttributedMetaModel.cs
- ElementHostAutomationPeer.cs
- FrugalMap.cs
- SoapProtocolImporter.cs
- AuthorizationSection.cs
- httpapplicationstate.cs
- InstanceLockedException.cs
- BindingManagerDataErrorEventArgs.cs
- DotExpr.cs
- BStrWrapper.cs
- XmlSchemaAnnotation.cs
- RemoteEndpointMessageProperty.cs
- StorageEntityTypeMapping.cs
- ScrollBarAutomationPeer.cs
- ZipArchive.cs
- DuplicateWaitObjectException.cs
- HorizontalAlignConverter.cs
- OpenTypeLayoutCache.cs
- initElementDictionary.cs
- ScrollProviderWrapper.cs
- JoinTreeSlot.cs
- querybuilder.cs
- GridViewRowCollection.cs
- Mapping.cs
- FormViewUpdateEventArgs.cs
- GridViewColumnHeaderAutomationPeer.cs
- InternalControlCollection.cs
- ReadOnlyCollectionBase.cs
- XmlILOptimizerVisitor.cs
- ObjectRef.cs
- serverconfig.cs
- CardSpaceSelector.cs
- EncoderReplacementFallback.cs
- NoPersistProperty.cs
- SqlParameterCollection.cs
- OuterGlowBitmapEffect.cs
- ValueType.cs
- CodeCompileUnit.cs
- GridPatternIdentifiers.cs
- CapiHashAlgorithm.cs
- MediaTimeline.cs
- NeutralResourcesLanguageAttribute.cs
- SqlTypesSchemaImporter.cs
- HuffCodec.cs
- EdmScalarPropertyAttribute.cs
- GeometryCollection.cs
- DataGridHeaderBorder.cs
- UTF7Encoding.cs
- EventMappingSettingsCollection.cs
- MemberProjectedSlot.cs
- Source.cs
- ImmutableObjectAttribute.cs
- DataGridToolTip.cs
- ISessionStateStore.cs
- WebConfigManager.cs
- Control.cs
- Configuration.cs
- ConnectionManagementElement.cs
- ClosableStream.cs