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
- XPathPatternBuilder.cs
- DesignTimeParseData.cs
- BitmapCache.cs
- xml.cs
- PageThemeCodeDomTreeGenerator.cs
- DateTimeConverter.cs
- TextAnchor.cs
- StringComparer.cs
- Parallel.cs
- CheckBoxField.cs
- streamingZipPartStream.cs
- _ProxyRegBlob.cs
- ProtocolsSection.cs
- MsmqPoisonMessageException.cs
- TemplateControl.cs
- EnumType.cs
- ReservationNotFoundException.cs
- SuppressMergeCheckAttribute.cs
- XmlNodeList.cs
- ConstrainedDataObject.cs
- LeaseManager.cs
- ForwardPositionQuery.cs
- WebPart.cs
- DecoderBestFitFallback.cs
- SelectionEditor.cs
- AncillaryOps.cs
- Control.cs
- AdRotator.cs
- ExecutionEngineException.cs
- GlyphsSerializer.cs
- DesignerActionKeyboardBehavior.cs
- SessionEndingCancelEventArgs.cs
- DbProviderSpecificTypePropertyAttribute.cs
- GlyphingCache.cs
- OpacityConverter.cs
- SqlUtils.cs
- BindingCollection.cs
- XmlReflectionMember.cs
- BroadcastEventHelper.cs
- InternalTypeHelper.cs
- InfiniteTimeSpanConverter.cs
- UrlPath.cs
- InternalBufferOverflowException.cs
- IISMapPath.cs
- ConfigurationValues.cs
- login.cs
- UndoManager.cs
- dataprotectionpermission.cs
- LongTypeConverter.cs
- ObjectItemLoadingSessionData.cs
- DocumentViewerConstants.cs
- DbParameterCollection.cs
- ModelTreeManager.cs
- PolyLineSegment.cs
- PropertyPath.cs
- DataGridViewComboBoxColumnDesigner.cs
- Triplet.cs
- ExtenderControl.cs
- BoolExpressionVisitors.cs
- WinInetCache.cs
- ScriptingRoleServiceSection.cs
- Run.cs
- TypeSystem.cs
- AuthenticationService.cs
- CssStyleCollection.cs
- PolyBezierSegment.cs
- StorageScalarPropertyMapping.cs
- AnnotationAdorner.cs
- _UriSyntax.cs
- Soap11ServerProtocol.cs
- DateTimeUtil.cs
- ButtonChrome.cs
- GeneralTransformCollection.cs
- ProtocolsSection.cs
- ObjectHandle.cs
- ColumnWidthChangedEvent.cs
- KeyEventArgs.cs
- ToolStripItemTextRenderEventArgs.cs
- ProfileSettingsCollection.cs
- ListMarkerSourceInfo.cs
- CommandLibraryHelper.cs
- WebPartVerbCollection.cs
- CodeMemberEvent.cs
- SizeAnimationClockResource.cs
- WebControlAdapter.cs
- CurrentChangedEventManager.cs
- Menu.cs
- ListViewInsertionMark.cs
- ToolStripAdornerWindowService.cs
- PeerTransportBindingElement.cs
- CustomError.cs
- mediapermission.cs
- TransactionException.cs
- GeometryValueSerializer.cs
- FusionWrap.cs
- Normalization.cs
- RoleGroup.cs
- PropertySourceInfo.cs
- ResourceCodeDomSerializer.cs
- OleStrCAMarshaler.cs