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
- PathGradientBrush.cs
- SapiAttributeParser.cs
- StateFinalizationDesigner.cs
- FixedDocumentPaginator.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ColumnBinding.cs
- GridViewRowPresenterBase.cs
- Pair.cs
- MobileControlPersister.cs
- FormsAuthenticationUserCollection.cs
- TreeNodeBinding.cs
- VarInfo.cs
- GorillaCodec.cs
- ScriptDescriptor.cs
- StringInfo.cs
- BlurEffect.cs
- ListViewDeletedEventArgs.cs
- EncodingTable.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- SortedDictionary.cs
- SimpleBitVector32.cs
- TemplateField.cs
- SoapHeaderAttribute.cs
- CTreeGenerator.cs
- StrongNameKeyPair.cs
- RuntimeConfigLKG.cs
- UrlMappingsSection.cs
- CodeCommentStatement.cs
- ActivityWithResultWrapper.cs
- RawTextInputReport.cs
- Codec.cs
- QilInvokeEarlyBound.cs
- BaseTemplateBuildProvider.cs
- RowSpanVector.cs
- SqlTriggerAttribute.cs
- TypeElementCollection.cs
- OleDbDataReader.cs
- BaseDataList.cs
- Rotation3D.cs
- State.cs
- SimpleTextLine.cs
- ImageList.cs
- PeerApplicationLaunchInfo.cs
- TextCharacters.cs
- HostProtectionException.cs
- DataGridViewRowStateChangedEventArgs.cs
- Schema.cs
- PropertyChangeTracker.cs
- ExtensionQuery.cs
- base64Transforms.cs
- util.cs
- FixedFindEngine.cs
- HelpEvent.cs
- BehaviorEditorPart.cs
- Pair.cs
- ArgumentNullException.cs
- BrushMappingModeValidation.cs
- MergeFailedEvent.cs
- NullableFloatSumAggregationOperator.cs
- TraceSource.cs
- SingleSelectRootGridEntry.cs
- XmlTextReaderImplHelpers.cs
- DatasetMethodGenerator.cs
- CopyEncoder.cs
- GridViewDeletedEventArgs.cs
- PaperSource.cs
- shaperfactoryquerycacheentry.cs
- DataTableExtensions.cs
- XmlSchemaSubstitutionGroup.cs
- TemplateComponentConnector.cs
- PrinterSettings.cs
- EntityProviderServices.cs
- WindowsStartMenu.cs
- ListView.cs
- RtfControls.cs
- DelayedRegex.cs
- XslNumber.cs
- BindingManagerDataErrorEventArgs.cs
- RunWorkerCompletedEventArgs.cs
- ConvertBinder.cs
- Win32SafeHandles.cs
- ItemsPresenter.cs
- SrgsRulesCollection.cs
- EntityContainerEmitter.cs
- XamlSerializationHelper.cs
- HtmlSelect.cs
- FixedSOMPage.cs
- RootProfilePropertySettingsCollection.cs
- XmlTypeMapping.cs
- DataSysAttribute.cs
- LongAverageAggregationOperator.cs
- WebHttpBindingCollectionElement.cs
- WindowHideOrCloseTracker.cs
- ObjectNavigationPropertyMapping.cs
- SemanticKeyElement.cs
- Cursor.cs
- OracleConnectionStringBuilder.cs
- CodeNamespaceCollection.cs
- TextRange.cs