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
- ComboBoxRenderer.cs
- Comparer.cs
- EditCommandColumn.cs
- Misc.cs
- SymDocumentType.cs
- ProgressChangedEventArgs.cs
- SqlCommandSet.cs
- Rect3DValueSerializer.cs
- EntityDataSourceViewSchema.cs
- ButtonBaseAutomationPeer.cs
- SessionStateItemCollection.cs
- HtmlPageAdapter.cs
- Overlapped.cs
- NativeMethods.cs
- StyleModeStack.cs
- __ComObject.cs
- PageAsyncTaskManager.cs
- httpserverutility.cs
- COM2ExtendedTypeConverter.cs
- AuthenticationSection.cs
- GroupQuery.cs
- JsonGlobals.cs
- ColorConverter.cs
- PropertyManager.cs
- CodeObject.cs
- XpsStructure.cs
- dsa.cs
- TextServicesCompartmentEventSink.cs
- Pen.cs
- HttpInputStream.cs
- DataObjectEventArgs.cs
- NodeFunctions.cs
- TemplateControlParser.cs
- DuplexChannel.cs
- CodeSubDirectoriesCollection.cs
- HttpSessionStateBase.cs
- SqlProviderManifest.cs
- BaseUriHelper.cs
- WCFModelStrings.Designer.cs
- NotSupportedException.cs
- BezierSegment.cs
- ResourceType.cs
- OdbcDataAdapter.cs
- localization.cs
- SafeHandles.cs
- SqlBuilder.cs
- CustomValidator.cs
- QilGenerator.cs
- BrowserCapabilitiesFactory.cs
- ConfigUtil.cs
- DbInsertCommandTree.cs
- CacheSection.cs
- DetectRunnableInstancesTask.cs
- MediaPlayer.cs
- AssemblyBuilderData.cs
- ButtonRenderer.cs
- DataServiceRequest.cs
- BinaryFormatterSinks.cs
- DynamicVirtualDiscoSearcher.cs
- GB18030Encoding.cs
- PermissionListSet.cs
- Avt.cs
- SynchronizingStream.cs
- MetricEntry.cs
- TreeIterators.cs
- NavigationPropertyEmitter.cs
- EntitySqlQueryCacheKey.cs
- AutomationIdentifier.cs
- UrlAuthFailedErrorFormatter.cs
- TimerEventSubscription.cs
- IChannel.cs
- DiagnosticsConfiguration.cs
- xmlNames.cs
- OdbcRowUpdatingEvent.cs
- OperationCanceledException.cs
- BasicKeyConstraint.cs
- XmlReaderDelegator.cs
- CheckBoxBaseAdapter.cs
- TypeToArgumentTypeConverter.cs
- JournalEntryStack.cs
- TextEditorThreadLocalStore.cs
- ListItemCollection.cs
- MsmqIntegrationMessageProperty.cs
- cookie.cs
- GridViewCellAutomationPeer.cs
- SkewTransform.cs
- KeyInterop.cs
- SingleAnimationUsingKeyFrames.cs
- RowUpdatedEventArgs.cs
- QueueProcessor.cs
- AssociationSetMetadata.cs
- WaitHandle.cs
- AssemblyEvidenceFactory.cs
- KeyValueConfigurationCollection.cs
- CfgSemanticTag.cs
- XmlSchemaGroupRef.cs
- RowsCopiedEventArgs.cs
- jithelpers.cs
- TargetException.cs
- TextDpi.cs