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
- XsltOutput.cs
- ClientScriptItem.cs
- SqlServer2KCompatibilityAnnotation.cs
- compensatingcollection.cs
- NativeMethods.cs
- InvalidComObjectException.cs
- GrammarBuilderWildcard.cs
- LogPolicy.cs
- OleDbFactory.cs
- Completion.cs
- RadioButtonBaseAdapter.cs
- TextCollapsingProperties.cs
- MasterPageParser.cs
- MetadataArtifactLoaderFile.cs
- GPRECT.cs
- PopupEventArgs.cs
- DatePickerDateValidationErrorEventArgs.cs
- Latin1Encoding.cs
- RequestQueue.cs
- TransactionsSectionGroup.cs
- DispatchOperation.cs
- XmlLanguage.cs
- Journaling.cs
- HttpAsyncResult.cs
- MatrixTransform.cs
- RegexInterpreter.cs
- ObjectKeyFrameCollection.cs
- Delegate.cs
- SHA512Managed.cs
- XmlEventCache.cs
- IndexOutOfRangeException.cs
- DataControlCommands.cs
- MultiBindingExpression.cs
- BrowserDefinitionCollection.cs
- PrintPreviewControl.cs
- StrongNameIdentityPermission.cs
- AuthenticationSchemesHelper.cs
- StandardTransformFactory.cs
- Int32AnimationUsingKeyFrames.cs
- ColumnClickEvent.cs
- Point4D.cs
- SizeValueSerializer.cs
- GridViewRowEventArgs.cs
- HTMLTextWriter.cs
- SparseMemoryStream.cs
- SettingsBase.cs
- CqlIdentifiers.cs
- Privilege.cs
- RelatedPropertyManager.cs
- StackOverflowException.cs
- PolyBezierSegment.cs
- Menu.cs
- StreamGeometry.cs
- ReaderOutput.cs
- Exceptions.cs
- SqlServices.cs
- IChannel.cs
- XmlHierarchyData.cs
- Msec.cs
- ColumnWidthChangedEvent.cs
- TerminatorSinks.cs
- DecimalKeyFrameCollection.cs
- ReadOnlyObservableCollection.cs
- XPathSelfQuery.cs
- EntitySetBase.cs
- PeerApplication.cs
- MembershipPasswordException.cs
- CollectionBuilder.cs
- COM2PictureConverter.cs
- LabelAutomationPeer.cs
- ActiveXMessageFormatter.cs
- SimpleApplicationHost.cs
- HtmlInputPassword.cs
- BoundField.cs
- NamedPermissionSet.cs
- TableLayoutSettings.cs
- SqlDataSourceCache.cs
- DaylightTime.cs
- TreeBuilderXamlTranslator.cs
- Rfc2898DeriveBytes.cs
- CoreSwitches.cs
- DictionarySurrogate.cs
- PolyQuadraticBezierSegment.cs
- StringUtil.cs
- Menu.cs
- ContextMenuStrip.cs
- TypographyProperties.cs
- VScrollBar.cs
- ExtensibleClassFactory.cs
- Parser.cs
- User.cs
- Rotation3DKeyFrameCollection.cs
- MetadataProperty.cs
- EpmCustomContentSerializer.cs
- XmlUtf8RawTextWriter.cs
- ConfigDefinitionUpdates.cs
- HttpSocketManager.cs
- BitmapEffect.cs
- Set.cs
- InfoCardKeyedHashAlgorithm.cs