Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ProxyElement.cs
- METAHEADER.cs
- MultipleViewProviderWrapper.cs
- Tuple.cs
- DropDownList.cs
- XamlDesignerSerializationManager.cs
- XmlSchemaDatatype.cs
- DefaultProxySection.cs
- MessageQueuePermissionAttribute.cs
- IPAddress.cs
- CharUnicodeInfo.cs
- _FtpDataStream.cs
- TabPage.cs
- StringResourceManager.cs
- TextTreeText.cs
- TextAnchor.cs
- XComponentModel.cs
- FederatedMessageSecurityOverHttpElement.cs
- ToolConsole.cs
- UserPreferenceChangingEventArgs.cs
- StatusBarDesigner.cs
- ContextMarshalException.cs
- SessionPageStateSection.cs
- AssemblyCollection.cs
- SessionConnectionReader.cs
- ArrayList.cs
- DataGridViewEditingControlShowingEventArgs.cs
- SourceCollection.cs
- AsyncResult.cs
- RegexRunnerFactory.cs
- SchemaHelper.cs
- AutomationAttributeInfo.cs
- Token.cs
- CompatibleComparer.cs
- ButtonAutomationPeer.cs
- Normalization.cs
- LabelEditEvent.cs
- MetadataSerializer.cs
- SharedConnectionWorkflowTransactionService.cs
- MetadataPropertyvalue.cs
- CookieProtection.cs
- DataGridViewImageColumn.cs
- GC.cs
- AuthorizationRule.cs
- TargetConverter.cs
- StructuredTypeEmitter.cs
- MatrixAnimationBase.cs
- SettingsAttributeDictionary.cs
- InternalsVisibleToAttribute.cs
- HttpContext.cs
- HierarchicalDataSourceIDConverter.cs
- StylusDevice.cs
- HttpCachePolicy.cs
- ConvertBinder.cs
- TypedTableBase.cs
- OutputScopeManager.cs
- CodeCompiler.cs
- TreeChangeInfo.cs
- Relationship.cs
- SqlInternalConnectionTds.cs
- GridViewUpdateEventArgs.cs
- CombinedGeometry.cs
- Int16AnimationUsingKeyFrames.cs
- ConfigurationSchemaErrors.cs
- FileVersion.cs
- TableLayout.cs
- ErrorRuntimeConfig.cs
- Context.cs
- DynamicControlParameter.cs
- XsdBuildProvider.cs
- OdbcTransaction.cs
- TypeBuilder.cs
- EventLogPermissionEntryCollection.cs
- MultilineStringConverter.cs
- ToolStripItemRenderEventArgs.cs
- WebPartActionVerb.cs
- CalendarAutomationPeer.cs
- UriTemplate.cs
- ProfileService.cs
- XmlComment.cs
- PerfCounterSection.cs
- InternalUserCancelledException.cs
- EntityTransaction.cs
- DesignerAttribute.cs
- CodeIdentifiers.cs
- CommandDesigner.cs
- X509Certificate.cs
- SettingsPropertyIsReadOnlyException.cs
- ControlCollection.cs
- XmlArrayAttribute.cs
- BrowserDefinitionCollection.cs
- XamlLoadErrorInfo.cs
- ConstNode.cs
- KnownBoxes.cs
- BitmapEffectState.cs
- HighContrastHelper.cs
- SocketPermission.cs
- XmlAttributeCache.cs
- FixedTextView.cs
- EncryptedType.cs