Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / NameValueConfigurationCollection.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataView.cs
- ContentElement.cs
- PersonalizationState.cs
- DocumentationServerProtocol.cs
- CustomWebEventKey.cs
- DocumentReferenceCollection.cs
- InputBindingCollection.cs
- Tablet.cs
- TextRange.cs
- PartitionerQueryOperator.cs
- DbConnectionPoolIdentity.cs
- WasAdminWrapper.cs
- Keywords.cs
- SQlBooleanStorage.cs
- PatternMatcher.cs
- KnownColorTable.cs
- TreeViewImageKeyConverter.cs
- AuthenticateEventArgs.cs
- ScrollViewer.cs
- BuildProviderCollection.cs
- HttpFileCollectionWrapper.cs
- ToolboxItemFilterAttribute.cs
- LabelAutomationPeer.cs
- HitTestDrawingContextWalker.cs
- FontStretch.cs
- SoapInteropTypes.cs
- DataGridViewCellStyleConverter.cs
- Style.cs
- AuthenticatingEventArgs.cs
- CheckBox.cs
- XPathParser.cs
- NamedPipeProcessProtocolHandler.cs
- ActivityWithResult.cs
- SqlDataReader.cs
- PasswordBox.cs
- LoadGrammarCompletedEventArgs.cs
- HttpCapabilitiesEvaluator.cs
- GuidConverter.cs
- QueryableDataSource.cs
- UncommonField.cs
- ObjectManager.cs
- HtmlMeta.cs
- DataBindingExpressionBuilder.cs
- Accessors.cs
- PlaceHolder.cs
- propertyentry.cs
- DetailsView.cs
- XmlTextAttribute.cs
- srgsitem.cs
- CodeConstructor.cs
- SafeNativeMethods.cs
- PrePrepareMethodAttribute.cs
- HttpInputStream.cs
- CalendarButton.cs
- BooleanConverter.cs
- FieldToken.cs
- WeakRefEnumerator.cs
- ToolTipService.cs
- CompilerLocalReference.cs
- TypeSystemHelpers.cs
- DbParameterHelper.cs
- Exceptions.cs
- ExistsInCollection.cs
- OrderToken.cs
- SymbolTable.cs
- SpellerError.cs
- VirtualPathUtility.cs
- EntityTransaction.cs
- basevalidator.cs
- FixedDocumentSequencePaginator.cs
- URLString.cs
- TemplatePagerField.cs
- NotifyIcon.cs
- WindowsToolbar.cs
- QueuePathDialog.cs
- RelationshipFixer.cs
- RecognizedPhrase.cs
- SHA384CryptoServiceProvider.cs
- OdbcFactory.cs
- PictureBox.cs
- DesignTimeType.cs
- ComplexTypeEmitter.cs
- ButtonColumn.cs
- BamlLocalizableResourceKey.cs
- QueryPageSettingsEventArgs.cs
- NetworkStream.cs
- PersistenceProviderBehavior.cs
- UtilityExtension.cs
- PermissionAttributes.cs
- ApplyImportsAction.cs
- SamlAuthorizationDecisionClaimResource.cs
- DesignerCommandSet.cs
- EngineSiteSapi.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- DictionaryBase.cs
- CookielessHelper.cs
- VectorAnimationUsingKeyFrames.cs
- ShaderRenderModeValidation.cs
- RichTextBoxAutomationPeer.cs
- thaishape.cs