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
- PerfProviderCollection.cs
- C14NUtil.cs
- Soap.cs
- QuadraticBezierSegment.cs
- ThreadPool.cs
- BackgroundWorker.cs
- RoutedEventHandlerInfo.cs
- MemberRelationshipService.cs
- WorkflowCreationContext.cs
- DataGridViewRow.cs
- CompModSwitches.cs
- DesignerDataTable.cs
- TimeSpanStorage.cs
- EventLogPermissionEntryCollection.cs
- FileVersionInfo.cs
- InputScope.cs
- SoapExtensionTypeElement.cs
- SqlRowUpdatedEvent.cs
- CollectionAdapters.cs
- ObjectReaderCompiler.cs
- UInt64Storage.cs
- GroupStyle.cs
- WSHttpBinding.cs
- XmlReader.cs
- OdbcConnectionFactory.cs
- TraceHandlerErrorFormatter.cs
- IteratorFilter.cs
- Comparer.cs
- AutoCompleteStringCollection.cs
- BamlLocalizer.cs
- ObjectStateFormatter.cs
- XmlDictionaryReaderQuotas.cs
- PropertyTab.cs
- DescendentsWalker.cs
- VisualStyleInformation.cs
- HttpProfileGroupBase.cs
- Activity.cs
- ImageInfo.cs
- ServicePoint.cs
- HttpProtocolImporter.cs
- ListViewEditEventArgs.cs
- BaseTemplateCodeDomTreeGenerator.cs
- XmlUtilWriter.cs
- SystemTcpConnection.cs
- XmlElement.cs
- DefaultMemberAttribute.cs
- TextRangeEditTables.cs
- SafeThemeHandle.cs
- UnaryOperationBinder.cs
- Faults.cs
- BitmapEffectCollection.cs
- Group.cs
- Pkcs7Recipient.cs
- OuterGlowBitmapEffect.cs
- Latin1Encoding.cs
- X509ChainPolicy.cs
- AutoScrollHelper.cs
- LinqDataSourceDisposeEventArgs.cs
- BooleanSwitch.cs
- Calendar.cs
- ToolStripTemplateNode.cs
- NamespaceQuery.cs
- SingleObjectCollection.cs
- UseManagedPresentationBindingElementImporter.cs
- XmlSchemaGroup.cs
- CollectionType.cs
- InvalidCastException.cs
- EntityChangedParams.cs
- RectangleConverter.cs
- AttributeUsageAttribute.cs
- TCPClient.cs
- RenameRuleObjectDialog.cs
- WsdlBuildProvider.cs
- UInt64Converter.cs
- Trace.cs
- CssClassPropertyAttribute.cs
- RuleConditionDialog.Designer.cs
- BooleanFunctions.cs
- EventsTab.cs
- TemplateContentLoader.cs
- GenericTypeParameterBuilder.cs
- Validator.cs
- XmlSchemaComplexContent.cs
- ApplicationDirectory.cs
- RequestCachePolicyConverter.cs
- CheckBoxPopupAdapter.cs
- WebPartConnectionsCancelEventArgs.cs
- XmlNamespaceMappingCollection.cs
- Button.cs
- XPathDocument.cs
- AnimatedTypeHelpers.cs
- TypeSystem.cs
- IndexingContentUnit.cs
- MergePropertyDescriptor.cs
- ReferentialConstraintRoleElement.cs
- DesignerActionVerbItem.cs
- ExpressionEditorAttribute.cs
- PrivilegeNotHeldException.cs
- SqlConnectionHelper.cs
- ListManagerBindingsCollection.cs