Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- EntityTransaction.cs
- ViewPort3D.cs
- CreateUserErrorEventArgs.cs
- TypeBrowser.xaml.cs
- AnnotationStore.cs
- RadioButton.cs
- SettingsSection.cs
- PropertyConverter.cs
- PersonalizationDictionary.cs
- SHA512.cs
- RelatedPropertyManager.cs
- Stroke2.cs
- XsdBuildProvider.cs
- SQLBoolean.cs
- TypeGeneratedEventArgs.cs
- TextLine.cs
- Timer.cs
- TokenBasedSet.cs
- QueryCacheKey.cs
- SamlDelegatingWriter.cs
- Vector.cs
- BindableTemplateBuilder.cs
- X509SecurityTokenProvider.cs
- Vector3DCollectionValueSerializer.cs
- AssemblyBuilder.cs
- SortedList.cs
- MasterPageParser.cs
- DbDataReader.cs
- IList.cs
- ButtonBase.cs
- ConfigurationSectionGroupCollection.cs
- WindowsGraphicsWrapper.cs
- CodeMemberProperty.cs
- PictureBox.cs
- DataTableClearEvent.cs
- DbDeleteCommandTree.cs
- CompilerCollection.cs
- ColumnBinding.cs
- JsonEncodingStreamWrapper.cs
- FunctionParameter.cs
- DesignerOptionService.cs
- OleDbPermission.cs
- OutputCacheProfile.cs
- FunctionImportMapping.cs
- VisualBrush.cs
- TagMapInfo.cs
- ClientSettingsSection.cs
- MetadataExchangeBindings.cs
- UniqueEventHelper.cs
- DataServiceException.cs
- TemplateComponentConnector.cs
- MultiView.cs
- ConfigWriter.cs
- JapaneseLunisolarCalendar.cs
- PagesSection.cs
- SortableBindingList.cs
- CodeAssignStatement.cs
- FileNotFoundException.cs
- ServicesExceptionNotHandledEventArgs.cs
- hresults.cs
- OracleCommandSet.cs
- BitStream.cs
- DataExpression.cs
- StringAnimationBase.cs
- FileAuthorizationModule.cs
- ActiveXHost.cs
- DesignerPerfEventProvider.cs
- ZipIOModeEnforcingStream.cs
- KerberosReceiverSecurityToken.cs
- RoleManagerSection.cs
- loginstatus.cs
- SurrogateDataContract.cs
- ThousandthOfEmRealPoints.cs
- GifBitmapEncoder.cs
- RoleGroupCollection.cs
- DynamicActivityTypeDescriptor.cs
- SecurityKeyIdentifierClause.cs
- _Rfc2616CacheValidators.cs
- JsonReaderDelegator.cs
- LocalizabilityAttribute.cs
- SecurityManager.cs
- XmlTextWriter.cs
- PopupRootAutomationPeer.cs
- DataGridViewRowsAddedEventArgs.cs
- _UncName.cs
- RegexGroupCollection.cs
- ResolveNameEventArgs.cs
- XamlTypeMapperSchemaContext.cs
- TransformConverter.cs
- ListViewSortEventArgs.cs
- TimeZone.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- Rotation3DKeyFrameCollection.cs
- PartDesigner.cs
- ComplexType.cs
- SafeBitVector32.cs
- RtfControlWordInfo.cs
- BoundColumn.cs
- LinqToSqlWrapper.cs
- ExpandedProjectionNode.cs