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
- PackWebRequest.cs
- TableNameAttribute.cs
- nulltextcontainer.cs
- Figure.cs
- ImpersonateTokenRef.cs
- GlyphingCache.cs
- PiiTraceSource.cs
- AutomationPatternInfo.cs
- TableRowGroup.cs
- Cursor.cs
- CompilerGeneratedAttribute.cs
- CacheSection.cs
- SmiGettersStream.cs
- CodeLabeledStatement.cs
- Type.cs
- BitmapEffectCollection.cs
- ExtendedTransformFactory.cs
- InputProcessorProfilesLoader.cs
- ItemCollection.cs
- NumericUpDownAccelerationCollection.cs
- LocalFileSettingsProvider.cs
- TextComposition.cs
- PersonalizationStateInfo.cs
- Size3DConverter.cs
- DelegatedStream.cs
- XPathNodeList.cs
- TextEvent.cs
- EntityDesignerDataSourceView.cs
- SqlNotificationRequest.cs
- RangeValuePattern.cs
- XhtmlBasicCommandAdapter.cs
- FileDialog_Vista.cs
- Int16AnimationBase.cs
- RightsManagementInformation.cs
- PagesSection.cs
- PointValueSerializer.cs
- Events.cs
- SerializationAttributes.cs
- NullExtension.cs
- ProtocolsConfigurationHandler.cs
- SerializationHelper.cs
- SafeHandles.cs
- RuleSetDialog.cs
- QueryCacheKey.cs
- ReverseInheritProperty.cs
- SBCSCodePageEncoding.cs
- ListComponentEditorPage.cs
- AttachedPropertyInfo.cs
- FlowSwitch.cs
- TcpProcessProtocolHandler.cs
- PlanCompiler.cs
- NativeMethodsCLR.cs
- DataGridItemEventArgs.cs
- DbProviderConfigurationHandler.cs
- TextCompositionEventArgs.cs
- DiscriminatorMap.cs
- OleDbErrorCollection.cs
- PackagePartCollection.cs
- CodeDirectionExpression.cs
- StatusBar.cs
- XmlAttributes.cs
- XmlHierarchicalEnumerable.cs
- ObjectCloneHelper.cs
- VideoDrawing.cs
- TabControl.cs
- XmlSchemaChoice.cs
- InlinedAggregationOperatorEnumerator.cs
- ReadOnlyCollectionBase.cs
- GenericAuthenticationEventArgs.cs
- PrintDialog.cs
- TableItemStyle.cs
- EventProviderWriter.cs
- XmlElementAttributes.cs
- XmlSchemaAppInfo.cs
- SimpleType.cs
- Latin1Encoding.cs
- HttpVersion.cs
- BaseTypeViewSchema.cs
- WebPartZoneBase.cs
- ToolStripRenderEventArgs.cs
- DetailsViewRowCollection.cs
- CodeSnippetStatement.cs
- BamlRecordWriter.cs
- TextEditorThreadLocalStore.cs
- XmlQueryRuntime.cs
- SocketAddress.cs
- FieldBuilder.cs
- DateTimeFormatInfo.cs
- RowCache.cs
- OutputCacheProfile.cs
- SectionXmlInfo.cs
- XmlSerializerAssemblyAttribute.cs
- AccessDataSourceView.cs
- ListViewUpdateEventArgs.cs
- VarInfo.cs
- GroupItemAutomationPeer.cs
- TransformConverter.cs
- GraphicsState.cs
- VisualStyleRenderer.cs
- ExpressionTable.cs