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
- TextCharacters.cs
- TraceUtility.cs
- UrlMappingCollection.cs
- ButtonPopupAdapter.cs
- TemplateXamlParser.cs
- MouseBinding.cs
- ProtocolsConfiguration.cs
- GACMembershipCondition.cs
- RefreshEventArgs.cs
- StyleCollection.cs
- IntegerValidatorAttribute.cs
- FontDialog.cs
- PnrpPermission.cs
- XmlAttributeAttribute.cs
- CheckPair.cs
- FlowLayout.cs
- DesignerSerializationManager.cs
- CodeExpressionCollection.cs
- DoubleConverter.cs
- Visual.cs
- TracedNativeMethods.cs
- PackageRelationshipSelector.cs
- SqlDependencyUtils.cs
- ContextActivityUtils.cs
- StyleSelector.cs
- TypedDatasetGenerator.cs
- GregorianCalendar.cs
- ExtendedPropertyCollection.cs
- webclient.cs
- MasterPageCodeDomTreeGenerator.cs
- FigureHelper.cs
- TransformPatternIdentifiers.cs
- MSHTMLHostUtil.cs
- BitmapEffectCollection.cs
- Point.cs
- IteratorFilter.cs
- Utility.cs
- DataIdProcessor.cs
- Quaternion.cs
- CounterCreationDataCollection.cs
- FrameworkContentElement.cs
- XPathScanner.cs
- ThicknessAnimationBase.cs
- Polygon.cs
- DiscoveryServerProtocol.cs
- AddInControllerImpl.cs
- TerminateWorkflow.cs
- ProfilePropertyNameValidator.cs
- PersonalizationProviderCollection.cs
- SrgsElementFactory.cs
- InOutArgumentConverter.cs
- TransformGroup.cs
- SHA384.cs
- MultiplexingDispatchMessageFormatter.cs
- RouteData.cs
- GeneratedContractType.cs
- SchemaTableOptionalColumn.cs
- Trace.cs
- SiteMapNode.cs
- ClientConvert.cs
- LinkAreaEditor.cs
- StrokeNodeOperations.cs
- FillErrorEventArgs.cs
- EFTableProvider.cs
- ReferenceSchema.cs
- ClientUrlResolverWrapper.cs
- QueryCreatedEventArgs.cs
- WriteTimeStream.cs
- HashSetEqualityComparer.cs
- TabletDevice.cs
- Exception.cs
- ArrayElementGridEntry.cs
- VBIdentifierTrimConverter.cs
- EntityType.cs
- SortAction.cs
- ConstraintStruct.cs
- WebPartZone.cs
- WebSysDescriptionAttribute.cs
- X509ChainPolicy.cs
- DocumentOrderQuery.cs
- ListItemViewAttribute.cs
- CodeLabeledStatement.cs
- MonthCalendar.cs
- CanonicalFormWriter.cs
- ToolStripRenderer.cs
- HealthMonitoringSection.cs
- HtmlHead.cs
- KeyTimeConverter.cs
- ListViewTableCell.cs
- DateTimeOffsetConverter.cs
- RadioButtonAutomationPeer.cs
- AffineTransform3D.cs
- Query.cs
- PostBackOptions.cs
- WebUtil.cs
- SecurityContextTokenValidationException.cs
- SmiXetterAccessMap.cs
- DesignTimeData.cs
- AccessControlList.cs
- ScrollProperties.cs