Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / ConfigurationPropertyCollection.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TextElement.cs
- DetailsViewDeleteEventArgs.cs
- BackgroundWorker.cs
- DataObjectCopyingEventArgs.cs
- XmlBoundElement.cs
- NodeLabelEditEvent.cs
- DependencyPropertyKey.cs
- SafeTokenHandle.cs
- QueryRewriter.cs
- TableLayoutPanel.cs
- RequestDescription.cs
- DataRowCollection.cs
- SafeFileMappingHandle.cs
- ResXFileRef.cs
- Utils.cs
- WinEventWrap.cs
- MetafileHeader.cs
- PrintEvent.cs
- DelegateArgumentReference.cs
- InterleavedZipPartStream.cs
- PasswordPropertyTextAttribute.cs
- ObjectTag.cs
- Region.cs
- RegexCode.cs
- MouseOverProperty.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- RewritingSimplifier.cs
- AssociativeAggregationOperator.cs
- COM2ExtendedUITypeEditor.cs
- EdmComplexTypeAttribute.cs
- GroupBox.cs
- PathNode.cs
- OleStrCAMarshaler.cs
- COM2TypeInfoProcessor.cs
- InternalBufferManager.cs
- DataGridViewRowEventArgs.cs
- DataServiceContext.cs
- MobileControlsSectionHelper.cs
- tooltip.cs
- Image.cs
- RelatedPropertyManager.cs
- userdatakeys.cs
- SiteMapDataSourceView.cs
- PathStreamGeometryContext.cs
- XamlStyleSerializer.cs
- Margins.cs
- FastPropertyAccessor.cs
- ConstNode.cs
- XmlStringTable.cs
- RoamingStoreFileUtility.cs
- XamlNamespaceHelper.cs
- SharedHttpTransportManager.cs
- EntityDataSourceView.cs
- StylusEventArgs.cs
- WSSecurityPolicy11.cs
- CollectionConverter.cs
- TrackingProfileDeserializationException.cs
- CustomSignedXml.cs
- RightsDocument.cs
- FunctionDescription.cs
- Configuration.cs
- ObjectPropertyMapping.cs
- ArrayTypeMismatchException.cs
- RNGCryptoServiceProvider.cs
- SecurityTokenProvider.cs
- CollectionViewSource.cs
- DataSourceXmlSubItemAttribute.cs
- SystemNetHelpers.cs
- WeakReferenceList.cs
- CheckBoxFlatAdapter.cs
- InvalidCastException.cs
- SqlXml.cs
- InitializationEventAttribute.cs
- Focus.cs
- CultureMapper.cs
- ImageSourceConverter.cs
- GridViewCancelEditEventArgs.cs
- MenuCommands.cs
- ActivityExecutionContextCollection.cs
- ByteRangeDownloader.cs
- HtmlFormWrapper.cs
- UIAgentInitializationException.cs
- ProfileInfo.cs
- SettingsSection.cs
- ListControlDataBindingHandler.cs
- _SingleItemRequestCache.cs
- WebBrowserEvent.cs
- ContentPropertyAttribute.cs
- SoapFault.cs
- Exceptions.cs
- FixedPageAutomationPeer.cs
- ObjectPersistData.cs
- XPathEmptyIterator.cs
- PointCollection.cs
- AttachedPropertyInfo.cs
- CaseStatement.cs
- PageThemeBuildProvider.cs
- StructuredType.cs
- FontEmbeddingManager.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs