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
- DataTablePropertyDescriptor.cs
- UrlMappingsModule.cs
- PriorityBinding.cs
- LocatorPart.cs
- SqlInternalConnectionTds.cs
- ParentQuery.cs
- MultiBindingExpression.cs
- EnlistmentTraceIdentifier.cs
- TreeViewImageGenerator.cs
- Calendar.cs
- WrapPanel.cs
- latinshape.cs
- wmiprovider.cs
- BindableAttribute.cs
- EventDescriptor.cs
- SymbolPair.cs
- ScriptResourceMapping.cs
- ContextMenuStrip.cs
- ChangePassword.cs
- EntityProxyTypeInfo.cs
- FlowDocumentPaginator.cs
- GroupLabel.cs
- VirtualPathUtility.cs
- TextRunTypographyProperties.cs
- MouseButton.cs
- sqlpipe.cs
- ListBase.cs
- UriParserTemplates.cs
- LongValidatorAttribute.cs
- TableProviderWrapper.cs
- Range.cs
- GridSplitter.cs
- SafeMILHandle.cs
- TextSelectionProcessor.cs
- DataGridViewTopRowAccessibleObject.cs
- XmlSiteMapProvider.cs
- AutomationPropertyInfo.cs
- DataDocumentXPathNavigator.cs
- COM2IPerPropertyBrowsingHandler.cs
- EventlogProvider.cs
- Instrumentation.cs
- CssClassPropertyAttribute.cs
- TextRange.cs
- X509Utils.cs
- TabControlAutomationPeer.cs
- EntityDataSourceEntityTypeFilterItem.cs
- PieceNameHelper.cs
- ADMembershipProvider.cs
- DataRowExtensions.cs
- ToolStripProgressBar.cs
- EventDescriptor.cs
- smtppermission.cs
- WindowsFormsHostAutomationPeer.cs
- SQLInt16Storage.cs
- XamlTemplateSerializer.cs
- AnnotationAdorner.cs
- cookie.cs
- AuditLogLocation.cs
- ChannelCredentials.cs
- PropertyPathConverter.cs
- ChtmlTextWriter.cs
- PrimitiveType.cs
- ActiveXContainer.cs
- ConfigurationValidatorAttribute.cs
- SignerInfo.cs
- Simplifier.cs
- DropShadowEffect.cs
- CodeTypeDelegate.cs
- XmlSchemaSubstitutionGroup.cs
- AnonymousIdentificationModule.cs
- SynchronizedInputAdaptor.cs
- ControlBindingsCollection.cs
- SystemWebSectionGroup.cs
- UnrecognizedPolicyAssertionElement.cs
- NameValueFileSectionHandler.cs
- PairComparer.cs
- Filter.cs
- PropertyIDSet.cs
- HtmlForm.cs
- MediaEntryAttribute.cs
- DocumentDesigner.cs
- BrowserCapabilitiesCodeGenerator.cs
- VideoDrawing.cs
- AdRotator.cs
- Scanner.cs
- ToolStripPanelCell.cs
- TransformerInfoCollection.cs
- TypeTypeConverter.cs
- VisualStyleTypesAndProperties.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- FormViewUpdateEventArgs.cs
- BaseValidator.cs
- LockCookie.cs
- EditorAttribute.cs
- XPathCompileException.cs
- Gdiplus.cs
- connectionpool.cs
- SchemaImporterExtensionsSection.cs
- VisualStyleElement.cs
- ClassDataContract.cs