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
- WsdlEndpointConversionContext.cs
- Authorization.cs
- DbConnectionFactory.cs
- OdbcStatementHandle.cs
- VersionPair.cs
- HiddenField.cs
- ReadOnlyNameValueCollection.cs
- DbConnectionOptions.cs
- DataGridPageChangedEventArgs.cs
- AssemblyFilter.cs
- CallSite.cs
- MemberProjectionIndex.cs
- MexHttpsBindingElement.cs
- ResXDataNode.cs
- _SafeNetHandles.cs
- DataSourceCache.cs
- XmlUtil.cs
- HttpResponseHeader.cs
- XmlArrayItemAttributes.cs
- ResourceSet.cs
- NumericUpDown.cs
- RestClientProxyHandler.cs
- TextDecoration.cs
- TextCharacters.cs
- DataList.cs
- Serializer.cs
- PointLight.cs
- UnsignedPublishLicense.cs
- PlanCompilerUtil.cs
- RecipientInfo.cs
- Stylesheet.cs
- ServiceX509SecurityTokenProvider.cs
- SymbolTable.cs
- SystemIPv6InterfaceProperties.cs
- HtmlControlPersistable.cs
- OSFeature.cs
- DocumentPaginator.cs
- CmsUtils.cs
- WebServiceHandlerFactory.cs
- Preprocessor.cs
- DbCommandDefinition.cs
- XPathNodePointer.cs
- ISessionStateStore.cs
- UserControlParser.cs
- Dictionary.cs
- _Win32.cs
- WebPartTransformer.cs
- LockCookie.cs
- DbDataAdapter.cs
- HtmlInputButton.cs
- InvalidateEvent.cs
- RSACryptoServiceProvider.cs
- WebMessageFormatHelper.cs
- TextInfo.cs
- StructuredTypeEmitter.cs
- NullableBoolConverter.cs
- _SslSessionsCache.cs
- GroupAggregateExpr.cs
- SocketAddress.cs
- Internal.cs
- SqlDataRecord.cs
- CategoryAttribute.cs
- ExpressionBindings.cs
- DummyDataSource.cs
- SemanticResultKey.cs
- WorkflowTransactionOptions.cs
- WebPartEventArgs.cs
- HostedTcpTransportManager.cs
- ADMembershipUser.cs
- NonVisualControlAttribute.cs
- Rotation3D.cs
- SafeLibraryHandle.cs
- SQLBytes.cs
- SerializerWriterEventHandlers.cs
- MediaEntryAttribute.cs
- AppDomainUnloadedException.cs
- CommandConverter.cs
- EventlogProvider.cs
- TextSchema.cs
- WorkItem.cs
- TextHidden.cs
- FormatSettings.cs
- CompilationUtil.cs
- CompoundFileStorageReference.cs
- ZoneIdentityPermission.cs
- TransformCryptoHandle.cs
- MessageSecurityException.cs
- CultureInfoConverter.cs
- CalendarDay.cs
- SmiEventSink.cs
- newinstructionaction.cs
- EventBuilder.cs
- EntityProviderServices.cs
- HttpCapabilitiesEvaluator.cs
- ConditionValidator.cs
- RelatedCurrencyManager.cs
- SafeNativeMethods.cs
- MeasureData.cs
- FloatSumAggregationOperator.cs
- DataSetUtil.cs