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
- PermissionToken.cs
- CultureSpecificStringDictionary.cs
- ItemsPresenter.cs
- PersistChildrenAttribute.cs
- ToolStripSplitButton.cs
- AsyncOperationManager.cs
- ViewGenerator.cs
- TagMapCollection.cs
- ChangeToolStripParentVerb.cs
- RenderCapability.cs
- CodeRemoveEventStatement.cs
- ExtensionQuery.cs
- TextEditorMouse.cs
- HttpProfileGroupBase.cs
- DbMetaDataCollectionNames.cs
- CallSiteBinder.cs
- CharAnimationUsingKeyFrames.cs
- TextLineBreak.cs
- StylusCollection.cs
- NavigationProperty.cs
- SymDocumentType.cs
- SigningCredentials.cs
- DBSchemaTable.cs
- CustomValidator.cs
- OdbcDataReader.cs
- ItemsChangedEventArgs.cs
- ToolboxDataAttribute.cs
- LowerCaseStringConverter.cs
- TextTreeRootTextBlock.cs
- ConfigXmlReader.cs
- RootDesignerSerializerAttribute.cs
- SubclassTypeValidator.cs
- TryLoadRunnableWorkflowCommand.cs
- UIElement3D.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- DynamicResourceExtensionConverter.cs
- UnsafeNativeMethods.cs
- BamlCollectionHolder.cs
- Menu.cs
- SweepDirectionValidation.cs
- GenerateTemporaryTargetAssembly.cs
- CutCopyPasteHelper.cs
- WebPartEditorApplyVerb.cs
- CapabilitiesPattern.cs
- DbException.cs
- StylusCaptureWithinProperty.cs
- InvalidDataException.cs
- ItemType.cs
- DataGridViewRowCancelEventArgs.cs
- _ConnectStream.cs
- SecurityKeyIdentifier.cs
- Root.cs
- WebPartDisplayModeCollection.cs
- StorageConditionPropertyMapping.cs
- RemotingSurrogateSelector.cs
- IDispatchConstantAttribute.cs
- UnsafeNativeMethods.cs
- ResourceDescriptionAttribute.cs
- ViewService.cs
- Matrix3DValueSerializer.cs
- ComponentTray.cs
- IsolatedStorageFilePermission.cs
- HostedElements.cs
- VisualTreeUtils.cs
- DataServiceBuildProvider.cs
- WebReferenceCollection.cs
- CannotUnloadAppDomainException.cs
- InputBinder.cs
- LiteralLink.cs
- EntityDataSourceContextCreatingEventArgs.cs
- QueryableDataSourceView.cs
- XsdBuilder.cs
- SessionStateContainer.cs
- Line.cs
- ManipulationStartingEventArgs.cs
- DecimalAnimationUsingKeyFrames.cs
- Trigger.cs
- ProfileProvider.cs
- StretchValidation.cs
- ColumnHeader.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- RegionInfo.cs
- HeaderUtility.cs
- CodeParameterDeclarationExpressionCollection.cs
- XmlSchemaAll.cs
- HttpModulesSection.cs
- UnionQueryOperator.cs
- Region.cs
- AbandonedMutexException.cs
- Bold.cs
- CaseStatement.cs
- DrawTreeNodeEventArgs.cs
- DataTableCollection.cs
- GuidConverter.cs
- PartitionerQueryOperator.cs
- BindableAttribute.cs
- DataTrigger.cs
- GenericWebPart.cs
- PiiTraceSource.cs
- Int32Animation.cs