Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Configuration / System / Configuration / NameValueConfigurationCollection.cs / 1 / NameValueConfigurationCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * ImmutableCollections * * Copyright (c) 2004 Microsoft Corporation */ using System; using System.Collections; using System.Collections.Specialized; using System.Net; using System.Configuration; // // This file contains configuration collections that are used by multiple sections // namespace System.Configuration { [ConfigurationCollection(typeof(NameValueConfigurationElement))] public sealed class NameValueConfigurationCollection : ConfigurationElementCollection { private static ConfigurationPropertyCollection _properties; static NameValueConfigurationCollection() { // Property initialization _properties = new ConfigurationPropertyCollection(); } protected internal override ConfigurationPropertyCollection Properties { get { return _properties; } } // // Constructor // public NameValueConfigurationCollection() { } // // Accessors // public new NameValueConfigurationElement this[string name] { get { return (NameValueConfigurationElement) BaseGet(name); } set { int index = -1; // append by default NameValueConfigurationElement tempElement = (NameValueConfigurationElement) BaseGet(name); if (tempElement != null) { index = BaseIndexOf(tempElement); BaseRemoveAt(index); } BaseAdd(index, value); } } public String[] AllKeys { get { return StringUtil.ObjectArrayToStringArray(BaseGetAllKeys()); } } // // Methods // public void Add(NameValueConfigurationElement nameValue) { BaseAdd(nameValue); } public void Remove(NameValueConfigurationElement nameValue) { if (BaseIndexOf(nameValue) >= 0) BaseRemove(nameValue.Name); } public void Remove(string name) { BaseRemove(name); } public void Clear() { BaseClear(); } protected override ConfigurationElement CreateNewElement() { return new NameValueConfigurationElement(); } protected override object GetElementKey(ConfigurationElement element) { return ((NameValueConfigurationElement)element).Name; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * ImmutableCollections * * Copyright (c) 2004 Microsoft Corporation */ using System; using System.Collections; using System.Collections.Specialized; using System.Net; using System.Configuration; // // This file contains configuration collections that are used by multiple sections // namespace System.Configuration { [ConfigurationCollection(typeof(NameValueConfigurationElement))] public sealed class NameValueConfigurationCollection : ConfigurationElementCollection { private static ConfigurationPropertyCollection _properties; static NameValueConfigurationCollection() { // Property initialization _properties = new ConfigurationPropertyCollection(); } protected internal override ConfigurationPropertyCollection Properties { get { return _properties; } } // // Constructor // public NameValueConfigurationCollection() { } // // Accessors // public new NameValueConfigurationElement this[string name] { get { return (NameValueConfigurationElement) BaseGet(name); } set { int index = -1; // append by default NameValueConfigurationElement tempElement = (NameValueConfigurationElement) BaseGet(name); if (tempElement != null) { index = BaseIndexOf(tempElement); BaseRemoveAt(index); } BaseAdd(index, value); } } public String[] AllKeys { get { return StringUtil.ObjectArrayToStringArray(BaseGetAllKeys()); } } // // Methods // public void Add(NameValueConfigurationElement nameValue) { BaseAdd(nameValue); } public void Remove(NameValueConfigurationElement nameValue) { if (BaseIndexOf(nameValue) >= 0) BaseRemove(nameValue.Name); } public void Remove(string name) { BaseRemove(name); } public void Clear() { BaseClear(); } protected override ConfigurationElement CreateNewElement() { return new NameValueConfigurationElement(); } protected override object GetElementKey(ConfigurationElement element) { return ((NameValueConfigurationElement)element).Name; } } } // 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
- CurrencyManager.cs
- MessageSecurityOverTcpElement.cs
- AsynchronousChannelMergeEnumerator.cs
- MexNamedPipeBindingCollectionElement.cs
- EnumerableRowCollectionExtensions.cs
- ExpressionNode.cs
- CookielessHelper.cs
- Debug.cs
- UrlRoutingModule.cs
- SafeNativeMethods.cs
- XmlSchemaValidator.cs
- ParallelEnumerable.cs
- CollectionTypeElement.cs
- XmlSchemaElement.cs
- ListViewCancelEventArgs.cs
- CacheSection.cs
- DataGridViewColumnCollectionDialog.cs
- EmissiveMaterial.cs
- DataGridViewHeaderCell.cs
- SafeNativeMethodsMilCoreApi.cs
- ClipboardData.cs
- WebEvents.cs
- TouchFrameEventArgs.cs
- ItemsPresenter.cs
- Calendar.cs
- UserPersonalizationStateInfo.cs
- PropertyCollection.cs
- WorkflowRuntimeService.cs
- PopOutPanel.cs
- SoapSchemaImporter.cs
- MouseWheelEventArgs.cs
- RelationshipEndMember.cs
- SimpleTextLine.cs
- XsdBuilder.cs
- WindowCollection.cs
- DataGridViewColumnEventArgs.cs
- MasterPageCodeDomTreeGenerator.cs
- FixedHighlight.cs
- _HTTPDateParse.cs
- ChainedAsyncResult.cs
- CodeMemberEvent.cs
- RegionInfo.cs
- VisualBasicExpressionConverter.cs
- MenuCommands.cs
- Int32RectValueSerializer.cs
- ForwardPositionQuery.cs
- SchemaAttDef.cs
- ParameterModifier.cs
- TypeUtil.cs
- DataGridViewTopRowAccessibleObject.cs
- PropertyDescriptorCollection.cs
- QilNode.cs
- TextRangeBase.cs
- ThreadAbortException.cs
- HiddenFieldPageStatePersister.cs
- ActionFrame.cs
- RequestStatusBarUpdateEventArgs.cs
- UpdatePanelControlTrigger.cs
- AutomationEvent.cs
- GetPageCompletedEventArgs.cs
- ImageClickEventArgs.cs
- InheritanceService.cs
- PrintPreviewDialog.cs
- DesignerActionGlyph.cs
- ModuleBuilder.cs
- ItemList.cs
- ObjectQueryProvider.cs
- CompositeTypefaceMetrics.cs
- PrimitiveDataContract.cs
- Properties.cs
- counter.cs
- CurrencyManager.cs
- UserPreferenceChangedEventArgs.cs
- invalidudtexception.cs
- TextEffect.cs
- DataGridTextBoxColumn.cs
- VirtualPathUtility.cs
- DefaultSettingsSection.cs
- ModelTreeEnumerator.cs
- XPathDocumentNavigator.cs
- MarkupObject.cs
- X509PeerCertificateAuthenticationElement.cs
- CollectionBuilder.cs
- HostingEnvironmentException.cs
- DataGridItem.cs
- SoundPlayerAction.cs
- SmiRequestExecutor.cs
- EpmSourceTree.cs
- XhtmlBasicFormAdapter.cs
- FormatterConverter.cs
- QueryResponse.cs
- AttributeProviderAttribute.cs
- ReferentialConstraint.cs
- SelectorItemAutomationPeer.cs
- Int64.cs
- TextChange.cs
- XmlSchemaElement.cs
- CompositionCommandSet.cs
- SizeAnimationUsingKeyFrames.cs
- MatchAllMessageFilter.cs