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
- InvokeMethodActivity.cs
- ConfigXmlElement.cs
- CommonDialog.cs
- WebConfigurationHostFileChange.cs
- UrlMapping.cs
- ToolboxService.cs
- BatchParser.cs
- BodyGlyph.cs
- MultiByteCodec.cs
- LocatorManager.cs
- IOThreadScheduler.cs
- Utility.cs
- ScopelessEnumAttribute.cs
- ToolStripDropDownMenu.cs
- EncodingInfo.cs
- PublisherIdentityPermission.cs
- OuterGlowBitmapEffect.cs
- Sequence.cs
- ItemList.cs
- DataMemberFieldConverter.cs
- SmiMetaData.cs
- ToolStripPanelCell.cs
- KnownBoxes.cs
- ViewSimplifier.cs
- WindowsGraphics2.cs
- ZipIOLocalFileDataDescriptor.cs
- MemberCollection.cs
- BaseDataBoundControl.cs
- HierarchicalDataTemplate.cs
- Overlapped.cs
- PropertyFilter.cs
- XhtmlTextWriter.cs
- Subtree.cs
- XhtmlBasicPhoneCallAdapter.cs
- ItemMap.cs
- ProxyHwnd.cs
- DesignerAdapterUtil.cs
- ManagementInstaller.cs
- Context.cs
- KeyGestureValueSerializer.cs
- InternalException.cs
- Rights.cs
- SqlError.cs
- ClientApiGenerator.cs
- SocketException.cs
- BlurEffect.cs
- LeftCellWrapper.cs
- FormParameter.cs
- ClassHandlersStore.cs
- RegistryPermission.cs
- MenuItemBindingCollection.cs
- Transform3D.cs
- ConfigurationStrings.cs
- LambdaCompiler.Binary.cs
- StorageMappingFragment.cs
- Choices.cs
- DataTableNameHandler.cs
- AdornerHitTestResult.cs
- TemplateNameScope.cs
- TypedElement.cs
- FontStyleConverter.cs
- MultiAsyncResult.cs
- URIFormatException.cs
- SplashScreen.cs
- NullRuntimeConfig.cs
- ObjectTypeMapping.cs
- SapiRecoContext.cs
- ConfigurationSectionGroupCollection.cs
- IOThreadScheduler.cs
- TypeNameConverter.cs
- OracleConnectionString.cs
- ColumnBinding.cs
- HtmlCommandAdapter.cs
- CodeTypeReference.cs
- TakeQueryOptionExpression.cs
- CallbackValidator.cs
- HelpKeywordAttribute.cs
- DataServiceQueryProvider.cs
- PointLightBase.cs
- ConfigurationElementCollection.cs
- RawStylusInputReport.cs
- TableParagraph.cs
- DescriptionAttribute.cs
- DataGridViewTopLeftHeaderCell.cs
- DebugControllerThread.cs
- DCSafeHandle.cs
- UserControlAutomationPeer.cs
- mactripleDES.cs
- HttpsChannelListener.cs
- EdmFunction.cs
- recordstatescratchpad.cs
- ImageListStreamer.cs
- WindowsStatic.cs
- webbrowsersite.cs
- MasterPageParser.cs
- NamedElement.cs
- DataSetMappper.cs
- AncillaryOps.cs
- XPathSingletonIterator.cs
- SqlUDTStorage.cs