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
- AddDataControlFieldDialog.cs
- Border.cs
- DbInsertCommandTree.cs
- ExternalException.cs
- ResourcePermissionBase.cs
- StateMachineSubscriptionManager.cs
- Math.cs
- LineInfo.cs
- MissingMemberException.cs
- TokenizerHelper.cs
- CodePageUtils.cs
- EventLogRecord.cs
- DataControlFieldHeaderCell.cs
- Normalizer.cs
- RelationshipConstraintValidator.cs
- Animatable.cs
- UserControl.cs
- SolidColorBrush.cs
- NamedServiceModelExtensionCollectionElement.cs
- DataServiceKeyAttribute.cs
- WindowVisualStateTracker.cs
- TemplateBaseAction.cs
- DataListCommandEventArgs.cs
- BooleanAnimationBase.cs
- DragDrop.cs
- XmlWrappingWriter.cs
- FontStretches.cs
- SafeProcessHandle.cs
- SamlAuthenticationClaimResource.cs
- WebContentFormatHelper.cs
- BindingContext.cs
- X509Certificate2Collection.cs
- ConfigXmlCDataSection.cs
- MLangCodePageEncoding.cs
- CompositionAdorner.cs
- ExceptionUtil.cs
- ActivityDesignerResources.cs
- DetailsViewCommandEventArgs.cs
- GridPatternIdentifiers.cs
- SoapCodeExporter.cs
- Keyboard.cs
- CodeChecksumPragma.cs
- PointConverter.cs
- GeneratedCodeAttribute.cs
- DrawToolTipEventArgs.cs
- ElementsClipboardData.cs
- SignedXml.cs
- HwndMouseInputProvider.cs
- ConfigurationProperty.cs
- XsdDuration.cs
- AttributeQuery.cs
- ObjectViewQueryResultData.cs
- ConnectionsZoneDesigner.cs
- ConfigurationManager.cs
- AudioStateChangedEventArgs.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- SecurityDocument.cs
- FrameAutomationPeer.cs
- TextElementCollectionHelper.cs
- DataRelation.cs
- HostingEnvironmentException.cs
- SqlBinder.cs
- KeyProperty.cs
- DirectoryNotFoundException.cs
- DataObjectMethodAttribute.cs
- Control.cs
- _DynamicWinsockMethods.cs
- InputScopeAttribute.cs
- FamilyMap.cs
- JumpTask.cs
- WaitHandleCannotBeOpenedException.cs
- TypeResolvingOptionsAttribute.cs
- DebugInfoExpression.cs
- ConfigurationManagerHelperFactory.cs
- ObjectList.cs
- XslAst.cs
- EnumerableValidator.cs
- RawTextInputReport.cs
- WindowInteractionStateTracker.cs
- ConnectionStringsExpressionBuilder.cs
- HttpFileCollection.cs
- ColumnWidthChangedEvent.cs
- RewritingPass.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- X509CertificateTrustedIssuerElementCollection.cs
- PassportAuthenticationModule.cs
- Properties.cs
- OleDbConnectionFactory.cs
- TagNameToTypeMapper.cs
- CallContext.cs
- Bits.cs
- ToolStripItemRenderEventArgs.cs
- DesignSurfaceEvent.cs
- SelectionHighlightInfo.cs
- UriSectionData.cs
- SslStream.cs
- ValueTable.cs
- WorkflowLayouts.cs
- EnumerableCollectionView.cs
- SocketInformation.cs