Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Configuration / System / Configuration / ConfigurationPropertyCollection.cs / 1 / ConfigurationPropertyCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; namespace System.Configuration { public class ConfigurationPropertyCollection : ICollection { private ArrayList _items = new ArrayList(); public int Count { get { return _items.Count; } } public bool IsSynchronized { get { return false; } } public Object SyncRoot { get { return _items; } } internal ConfigurationProperty DefaultCollectionProperty { get { return this[ConfigurationProperty.DefaultCollectionPropertyName]; } } void ICollection.CopyTo(Array array, int index) { _items.CopyTo(array, index); } public void CopyTo(ConfigurationProperty[] array, int index) { ((ICollection)this).CopyTo(array, index); } public IEnumerator GetEnumerator() { return _items.GetEnumerator(); } public ConfigurationProperty this[String name] { get { for (int index = 0; index < _items.Count; index++) { ConfigurationProperty cp = (ConfigurationProperty)_items[index]; if (cp.Name == name) { return (ConfigurationProperty)_items[index]; } } return (ConfigurationProperty)null; } } public bool Contains(String name) { for (int index = 0; index < _items.Count; index++) { ConfigurationProperty cp = (ConfigurationProperty)_items[index]; if (cp.Name == name) { return true; } } return false; } public void Add(ConfigurationProperty property) { if (Contains(property.Name) != true) { _items.Add(property); } } public bool Remove(string name) { for (int index = 0; index < _items.Count; index++) { ConfigurationProperty cp = (ConfigurationProperty)_items[index]; if (cp.Name == name) { _items.RemoveAt(index); return true; } } return false; } public void Clear() { _items.Clear(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; namespace System.Configuration { public class ConfigurationPropertyCollection : ICollection { private ArrayList _items = new ArrayList(); public int Count { get { return _items.Count; } } public bool IsSynchronized { get { return false; } } public Object SyncRoot { get { return _items; } } internal ConfigurationProperty DefaultCollectionProperty { get { return this[ConfigurationProperty.DefaultCollectionPropertyName]; } } void ICollection.CopyTo(Array array, int index) { _items.CopyTo(array, index); } public void CopyTo(ConfigurationProperty[] array, int index) { ((ICollection)this).CopyTo(array, index); } public IEnumerator GetEnumerator() { return _items.GetEnumerator(); } public ConfigurationProperty this[String name] { get { for (int index = 0; index < _items.Count; index++) { ConfigurationProperty cp = (ConfigurationProperty)_items[index]; if (cp.Name == name) { return (ConfigurationProperty)_items[index]; } } return (ConfigurationProperty)null; } } public bool Contains(String name) { for (int index = 0; index < _items.Count; index++) { ConfigurationProperty cp = (ConfigurationProperty)_items[index]; if (cp.Name == name) { return true; } } return false; } public void Add(ConfigurationProperty property) { if (Contains(property.Name) != true) { _items.Add(property); } } public bool Remove(string name) { for (int index = 0; index < _items.Count; index++) { ConfigurationProperty cp = (ConfigurationProperty)_items[index]; if (cp.Name == name) { _items.RemoveAt(index); return true; } } return false; } public void Clear() { _items.Clear(); } } } // 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
- TreeNodeBinding.cs
- XmlQueryOutput.cs
- ConnectionStringsSection.cs
- SecurityTokenReferenceStyle.cs
- GACIdentityPermission.cs
- DESCryptoServiceProvider.cs
- CompiledIdentityConstraint.cs
- HttpCapabilitiesEvaluator.cs
- CanonicalFontFamilyReference.cs
- RoutingService.cs
- HMACRIPEMD160.cs
- CollectionType.cs
- AlternateViewCollection.cs
- PageParserFilter.cs
- PropertyValueChangedEvent.cs
- DbProviderFactoriesConfigurationHandler.cs
- SimpleApplicationHost.cs
- HttpAsyncResult.cs
- precedingsibling.cs
- XmlObjectSerializerReadContextComplexJson.cs
- HttpResponseInternalBase.cs
- ListDictionaryInternal.cs
- BinaryWriter.cs
- DbProviderFactoriesConfigurationHandler.cs
- EUCJPEncoding.cs
- TypeDescriptor.cs
- ZoneIdentityPermission.cs
- Compress.cs
- DataGridColumnHeaderAutomationPeer.cs
- dataSvcMapFileLoader.cs
- SoapSchemaExporter.cs
- StyleModeStack.cs
- UriTemplateCompoundPathSegment.cs
- TimeSpanParse.cs
- DynamicControlParameter.cs
- DataGridViewRowPostPaintEventArgs.cs
- embossbitmapeffect.cs
- LogLogRecord.cs
- EventListener.cs
- BaseComponentEditor.cs
- DesignTimeParseData.cs
- CookieHandler.cs
- HttpRuntimeSection.cs
- AutoGeneratedField.cs
- TypedRowGenerator.cs
- CryptoKeySecurity.cs
- NumberFunctions.cs
- HMACSHA512.cs
- SatelliteContractVersionAttribute.cs
- RubberbandSelector.cs
- ScaleTransform3D.cs
- UnsafePeerToPeerMethods.cs
- RunInstallerAttribute.cs
- Selection.cs
- TabControlToolboxItem.cs
- DrawingCollection.cs
- ConfigXmlText.cs
- TransactionManager.cs
- HtmlGenericControl.cs
- FormsAuthenticationUserCollection.cs
- WebPartMenu.cs
- ExtensibleClassFactory.cs
- ElementMarkupObject.cs
- CollectionsUtil.cs
- SQLInt16Storage.cs
- PipeConnection.cs
- ViewLoader.cs
- FieldAccessException.cs
- SqlUtils.cs
- SqlFileStream.cs
- DataGridCommandEventArgs.cs
- __Filters.cs
- OverrideMode.cs
- ListenerSessionConnection.cs
- TextTreePropertyUndoUnit.cs
- ControlPropertyNameConverter.cs
- XmlSerializerAssemblyAttribute.cs
- ContextMarshalException.cs
- CLRBindingWorker.cs
- CmsInterop.cs
- MetadataArtifactLoaderFile.cs
- UnwrappedTypesXmlSerializerManager.cs
- InputLanguageManager.cs
- AdCreatedEventArgs.cs
- ThreadPool.cs
- TableCell.cs
- BoundColumn.cs
- BamlTreeNode.cs
- InitializerFacet.cs
- TimerEventSubscription.cs
- SspiHelper.cs
- MenuAutoFormat.cs
- WebServiceData.cs
- ObjectConverter.cs
- ExtenderProvidedPropertyAttribute.cs
- VScrollProperties.cs
- HScrollProperties.cs
- TriggerCollection.cs
- CannotUnloadAppDomainException.cs
- IntSecurity.cs