Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- RelationalExpressions.cs
- ObjectQueryState.cs
- FontStyleConverter.cs
- Schema.cs
- DiagnosticsConfigurationHandler.cs
- SoapDocumentMethodAttribute.cs
- AutomationEvent.cs
- ImageMetadata.cs
- WpfPayload.cs
- CalendarAutoFormat.cs
- XmlUTF8TextWriter.cs
- WebBrowserBase.cs
- SystemInformation.cs
- EncryptedType.cs
- WebBrowserSiteBase.cs
- SharedStatics.cs
- ConfigurationValidatorAttribute.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- AssemblyAssociatedContentFileAttribute.cs
- X509Chain.cs
- SerializerWriterEventHandlers.cs
- WebPartCollection.cs
- RootNamespaceAttribute.cs
- EdmComplexTypeAttribute.cs
- StackBuilderSink.cs
- StringFormat.cs
- ZipArchive.cs
- ProfessionalColorTable.cs
- TextDataBindingHandler.cs
- DataGridTableStyleMappingNameEditor.cs
- GlyphTypeface.cs
- MobileTemplatedControlDesigner.cs
- RestHandler.cs
- DBNull.cs
- DbQueryCommandTree.cs
- WebPartRestoreVerb.cs
- GetPageCompletedEventArgs.cs
- XamlVector3DCollectionSerializer.cs
- UnaryNode.cs
- ProcessThreadCollection.cs
- ManagementNamedValueCollection.cs
- BitmapCacheBrush.cs
- BitmapEncoder.cs
- RequestNavigateEventArgs.cs
- CapabilitiesState.cs
- RelationshipSet.cs
- ColorInterpolationModeValidation.cs
- HttpRuntime.cs
- DbTransaction.cs
- Timeline.cs
- QueryAccessibilityHelpEvent.cs
- _UriSyntax.cs
- SelectedPathEditor.cs
- WindowsTokenRoleProvider.cs
- BitConverter.cs
- AddInPipelineAttributes.cs
- SessionEndingEventArgs.cs
- BitmapEffectState.cs
- XamlSerializationHelper.cs
- RSAOAEPKeyExchangeFormatter.cs
- XmlConverter.cs
- WebReferencesBuildProvider.cs
- CodeAccessPermission.cs
- ProxyElement.cs
- NegationPusher.cs
- RadioButtonFlatAdapter.cs
- MdImport.cs
- ReadOnlyDataSource.cs
- EmptyQuery.cs
- DragDeltaEventArgs.cs
- Input.cs
- WebPageTraceListener.cs
- FileLoadException.cs
- SerializationObjectManager.cs
- IODescriptionAttribute.cs
- PermissionRequestEvidence.cs
- Vector3DValueSerializer.cs
- DataGridViewHitTestInfo.cs
- PropertyTabAttribute.cs
- WindowsScrollBar.cs
- DetailsViewUpdateEventArgs.cs
- Expression.DebuggerProxy.cs
- WebPartRestoreVerb.cs
- SafeSerializationManager.cs
- LineSegment.cs
- _AutoWebProxyScriptWrapper.cs
- AudioFileOut.cs
- WindowsAltTab.cs
- MasterPageBuildProvider.cs
- DataObjectAttribute.cs
- UpdateException.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- COM2PictureConverter.cs
- OrCondition.cs
- SynchronizationLockException.cs
- DbInsertCommandTree.cs
- NetworkCredential.cs
- ComponentChangingEvent.cs
- DependencyStoreSurrogate.cs
- BaseAddressPrefixFilterElementCollection.cs