Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- ConnectionStringsExpressionEditor.cs
- Soap.cs
- Monitor.cs
- ZipArchive.cs
- KnownTypes.cs
- CopyOnWriteList.cs
- TextParagraph.cs
- TextRange.cs
- XmlComplianceUtil.cs
- WindowsRichEdit.cs
- Win32PrintDialog.cs
- RequestCacheManager.cs
- LineProperties.cs
- DrawListViewItemEventArgs.cs
- XmlNamespaceMappingCollection.cs
- SQLCharsStorage.cs
- DataRowChangeEvent.cs
- QualifiedCellIdBoolean.cs
- x509utils.cs
- PipelineModuleStepContainer.cs
- BitmapEffectState.cs
- WinEventHandler.cs
- StylusEditingBehavior.cs
- WebSysDescriptionAttribute.cs
- MarkupCompiler.cs
- RelatedView.cs
- ElapsedEventArgs.cs
- securitycriticaldata.cs
- SqlDependency.cs
- SystemIPGlobalProperties.cs
- HuffModule.cs
- SecurityPolicySection.cs
- LocalBuilder.cs
- LassoSelectionBehavior.cs
- httpstaticobjectscollection.cs
- TableProviderWrapper.cs
- BinaryQueryOperator.cs
- String.cs
- DataGridItemEventArgs.cs
- DeferredRunTextReference.cs
- GenericWebPart.cs
- Stack.cs
- NegatedCellConstant.cs
- ToolStripContentPanelDesigner.cs
- ApplicationFileParser.cs
- SqlException.cs
- ToolStripItemClickedEventArgs.cs
- ConnectionConsumerAttribute.cs
- LayoutSettings.cs
- ProvideValueServiceProvider.cs
- MouseButton.cs
- WindowsTooltip.cs
- ScrollableControl.cs
- EncodingTable.cs
- FamilyTypeface.cs
- WindowsBrush.cs
- SecurityTimestamp.cs
- GlobalizationAssembly.cs
- TableStyle.cs
- NoResizeSelectionBorderGlyph.cs
- QuadraticBezierSegment.cs
- PartitionResolver.cs
- ScrollBar.cs
- Overlapped.cs
- Filter.cs
- ListSourceHelper.cs
- ScriptResourceMapping.cs
- VoiceChangeEventArgs.cs
- FontFamily.cs
- Item.cs
- CompilationUtil.cs
- XmlSchemaInfo.cs
- DataTableExtensions.cs
- ExclusiveHandle.cs
- IndexedString.cs
- ResourceAssociationSetEnd.cs
- IdnMapping.cs
- EncryptedReference.cs
- PropVariant.cs
- BehaviorEditorPart.cs
- GenericTextProperties.cs
- ItemCollection.cs
- OdbcParameterCollection.cs
- ClientSession.cs
- ScriptResourceInfo.cs
- ScriptReference.cs
- DataGridViewRowCancelEventArgs.cs
- CheckBoxField.cs
- EnumDataContract.cs
- SctClaimSerializer.cs
- SqlDataSourceStatusEventArgs.cs
- Add.cs
- SchemaElementDecl.cs
- AsyncCompletedEventArgs.cs
- KeyGesture.cs
- TextPattern.cs
- Journaling.cs
- XPathMultyIterator.cs
- CustomAttribute.cs
- DurableEnlistmentState.cs