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
- _AutoWebProxyScriptHelper.cs
- CompositeFontInfo.cs
- DefaultSerializationProviderAttribute.cs
- RtfNavigator.cs
- ReaderOutput.cs
- FileInfo.cs
- ClientRuntimeConfig.cs
- AnnotationHelper.cs
- XmlSerializerFaultFormatter.cs
- ConfigXmlComment.cs
- DataPagerFieldCollection.cs
- InputLanguage.cs
- SchemaConstraints.cs
- NetworkInformationException.cs
- SeparatorAutomationPeer.cs
- TreeView.cs
- DefaultValueConverter.cs
- PrincipalPermissionMode.cs
- Send.cs
- ToolStripDropDownButton.cs
- Metafile.cs
- CodeNamespaceImport.cs
- Win32Native.cs
- ConsoleCancelEventArgs.cs
- SqlServer2KCompatibilityAnnotation.cs
- ActivityBindForm.cs
- SafeTimerHandle.cs
- WmlSelectionListAdapter.cs
- InputLanguageProfileNotifySink.cs
- LinearGradientBrush.cs
- ButtonFieldBase.cs
- SmtpTransport.cs
- WizardStepCollectionEditor.cs
- ModuleElement.cs
- cookieexception.cs
- ReferenceConverter.cs
- PrimitiveCodeDomSerializer.cs
- HighContrastHelper.cs
- ColumnWidthChangedEvent.cs
- Metafile.cs
- MarginsConverter.cs
- TargetConverter.cs
- ContainerParagraph.cs
- OleDbRowUpdatedEvent.cs
- DataTrigger.cs
- ContentPosition.cs
- ProfilePropertyNameValidator.cs
- DataColumnCollection.cs
- Matrix3DConverter.cs
- ContractComponent.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- XmlStrings.cs
- ItemCheckEvent.cs
- ValidationVisibilityAttribute.cs
- CustomLineCap.cs
- CompilationPass2TaskInternal.cs
- DesignerDataSourceView.cs
- UnsafeNativeMethods.cs
- URL.cs
- CompatibleComparer.cs
- ValuePatternIdentifiers.cs
- CompiledXpathExpr.cs
- MetaType.cs
- WebReferencesBuildProvider.cs
- WebPartEditorOkVerb.cs
- PeerEndPoint.cs
- ImageListStreamer.cs
- ButtonBase.cs
- DataGridViewCellValidatingEventArgs.cs
- FileDialog_Vista_Interop.cs
- EventToken.cs
- ImageSourceValueSerializer.cs
- X500Name.cs
- HttpProcessUtility.cs
- DesignConnectionCollection.cs
- WebPartsPersonalizationAuthorization.cs
- ListenerSessionConnection.cs
- PointLightBase.cs
- ValidatedControlConverter.cs
- ParameterBuilder.cs
- FillBehavior.cs
- AnonymousIdentificationSection.cs
- XmlMapping.cs
- OciLobLocator.cs
- VectorCollectionConverter.cs
- SqlReferenceCollection.cs
- TemplatedWizardStep.cs
- ProgressBarAutomationPeer.cs
- ConstantProjectedSlot.cs
- PathGradientBrush.cs
- LinearGradientBrush.cs
- ACE.cs
- ResourceContainer.cs
- FormParameter.cs
- OutputChannel.cs
- SQLDateTime.cs
- ProfileProvider.cs
- DictionaryEditChange.cs
- ExpressionPrefixAttribute.cs
- _LocalDataStoreMgr.cs