Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / NameValueConfigurationCollection.cs / 1305376 / 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
- AlignmentXValidation.cs
- DoubleStorage.cs
- WSTransactionSection.cs
- Task.cs
- ObjectReferenceStack.cs
- Expressions.cs
- XmlElement.cs
- StringToken.cs
- MsdtcWrapper.cs
- Matrix.cs
- ThreadInterruptedException.cs
- SchemeSettingElementCollection.cs
- DesignerMetadata.cs
- UInt16Storage.cs
- StyleCollectionEditor.cs
- ReservationCollection.cs
- Types.cs
- BamlLocalizationDictionary.cs
- GlobalItem.cs
- TimeoutHelper.cs
- AbstractSvcMapFileLoader.cs
- TempEnvironment.cs
- QilStrConcatenator.cs
- DrawingGroupDrawingContext.cs
- DataTableNewRowEvent.cs
- DockAndAnchorLayout.cs
- DataSourceXmlSerializationAttribute.cs
- GroupItem.cs
- BaseCodeDomTreeGenerator.cs
- SettingsPropertyWrongTypeException.cs
- XMLSchema.cs
- ObjectDataSource.cs
- MetadataPropertyAttribute.cs
- CodeTypeDeclarationCollection.cs
- EntityReference.cs
- TreeViewCancelEvent.cs
- SizeFConverter.cs
- BindingValueChangedEventArgs.cs
- Win32.cs
- CommandDesigner.cs
- SynchronousSendBindingElement.cs
- MouseCaptureWithinProperty.cs
- MenuCommand.cs
- WebBaseEventKeyComparer.cs
- WmlControlAdapter.cs
- DbConnectionPoolCounters.cs
- HashAlgorithm.cs
- PathSegment.cs
- VisualTreeHelper.cs
- WebEvents.cs
- PageAdapter.cs
- BackgroundFormatInfo.cs
- CopyOnWriteList.cs
- _FtpDataStream.cs
- SeekableReadStream.cs
- ResXBuildProvider.cs
- GlyphRunDrawing.cs
- CacheEntry.cs
- ControlDesignerState.cs
- CustomGrammar.cs
- KeyToListMap.cs
- DataPager.cs
- ProfileEventArgs.cs
- xamlnodes.cs
- PolyBezierSegmentFigureLogic.cs
- LeaseManager.cs
- BitStack.cs
- UInt32Storage.cs
- ThrowHelper.cs
- SqlCacheDependencyDatabaseCollection.cs
- HuffCodec.cs
- ArraySubsetEnumerator.cs
- EventsTab.cs
- MSG.cs
- WebPartCollection.cs
- PriorityChain.cs
- HtmlInputCheckBox.cs
- DetailsViewUpdateEventArgs.cs
- EntityDataSourceColumn.cs
- QuestionEventArgs.cs
- TraceXPathNavigator.cs
- OletxCommittableTransaction.cs
- ColorBlend.cs
- LinkButton.cs
- MenuTracker.cs
- SeekStoryboard.cs
- ColorAnimationUsingKeyFrames.cs
- TextParaLineResult.cs
- ChannelCredentials.cs
- XmlBoundElement.cs
- StringBlob.cs
- EditorPart.cs
- DoubleStorage.cs
- XPathPatternParser.cs
- ListControlDataBindingHandler.cs
- ScriptControl.cs
- VariableQuery.cs
- ProfileSettingsCollection.cs
- AsyncOperationContext.cs
- EventDrivenDesigner.cs