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
- DesignerSelectionListAdapter.cs
- XmlAttributeCache.cs
- ListViewAutomationPeer.cs
- Module.cs
- RelationshipWrapper.cs
- TemplateNameScope.cs
- ClientSponsor.cs
- SqlSelectStatement.cs
- Interlocked.cs
- Image.cs
- _ConnectionGroup.cs
- ErrorProvider.cs
- ErrorWrapper.cs
- WorkflowDesignerColors.cs
- AnnotationComponentChooser.cs
- UpdateManifestForBrowserApplication.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- DateTimeUtil.cs
- ReflectEventDescriptor.cs
- DefaultValueTypeConverter.cs
- DataGridViewToolTip.cs
- xamlnodes.cs
- Drawing.cs
- AutomationPropertyInfo.cs
- CdpEqualityComparer.cs
- DataConnectionHelper.cs
- Style.cs
- login.cs
- RoutedCommand.cs
- GridView.cs
- ProcessThread.cs
- PageEventArgs.cs
- CheckBox.cs
- SAPIEngineTypes.cs
- SplineKeyFrames.cs
- CounterSample.cs
- OleDbException.cs
- XmlNullResolver.cs
- RadioButtonList.cs
- WebPartCatalogAddVerb.cs
- WithStatement.cs
- ObjectAnimationBase.cs
- ThreadPool.cs
- ComponentResourceKey.cs
- oledbmetadatacollectionnames.cs
- PolicyFactory.cs
- HtmlUtf8RawTextWriter.cs
- Util.cs
- MetadataCache.cs
- Contracts.cs
- Renderer.cs
- ClientApiGenerator.cs
- RoleGroup.cs
- RequestUriProcessor.cs
- TextTreeExtractElementUndoUnit.cs
- RemoteWebConfigurationHostStream.cs
- MetadataArtifactLoaderCompositeFile.cs
- VirtualPathProvider.cs
- RemotingAttributes.cs
- OleDbDataAdapter.cs
- WebPartPersonalization.cs
- NetworkInformationPermission.cs
- JumpTask.cs
- GestureRecognitionResult.cs
- HWStack.cs
- BitmapEffectGroup.cs
- SystemParameters.cs
- HostingPreferredMapPath.cs
- CredentialCache.cs
- LinkUtilities.cs
- WebPartMenuStyle.cs
- GridView.cs
- PrintingPermissionAttribute.cs
- ServiceAuthorizationBehavior.cs
- Maps.cs
- Events.cs
- CharEntityEncoderFallback.cs
- MembershipSection.cs
- AccessedThroughPropertyAttribute.cs
- EditorPartChrome.cs
- FaultImportOptions.cs
- HighlightComponent.cs
- BitmapInitialize.cs
- ModuleBuilderData.cs
- LocalizableAttribute.cs
- TableSectionStyle.cs
- CDSCollectionETWBCLProvider.cs
- HtmlSelectionListAdapter.cs
- TailCallAnalyzer.cs
- CompiledIdentityConstraint.cs
- XPathItem.cs
- EditorServiceContext.cs
- NavigatingCancelEventArgs.cs
- SubtreeProcessor.cs
- ExtractorMetadata.cs
- XPathNavigatorKeyComparer.cs
- ObjectConverter.cs
- FileNotFoundException.cs
- CommentEmitter.cs
- CachedBitmap.cs