Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- FixedSOMTable.cs
- XmlSchemaCompilationSettings.cs
- ColumnResizeUndoUnit.cs
- TypeToArgumentTypeConverter.cs
- PEFileEvidenceFactory.cs
- ReadWriteObjectLock.cs
- CursorInteropHelper.cs
- BypassElementCollection.cs
- SqlClientPermission.cs
- SqlNotificationEventArgs.cs
- login.cs
- SoapTypeAttribute.cs
- AnyReturnReader.cs
- ExtentKey.cs
- NativeWindow.cs
- DbConnectionOptions.cs
- ToolStripDropDownButton.cs
- ClientUtils.cs
- ToolStripGrip.cs
- _AutoWebProxyScriptHelper.cs
- WebMethodAttribute.cs
- BevelBitmapEffect.cs
- Italic.cs
- SoapCodeExporter.cs
- SimpleBitVector32.cs
- Section.cs
- SimpleApplicationHost.cs
- PageParserFilter.cs
- AttributeEmitter.cs
- SchemaTableOptionalColumn.cs
- FormatterServices.cs
- DataGridViewComboBoxColumn.cs
- fixedPageContentExtractor.cs
- DataBoundLiteralControl.cs
- PrintPreviewDialog.cs
- ToolStripContentPanel.cs
- RequestNavigateEventArgs.cs
- DataPagerCommandEventArgs.cs
- DataGridViewCellStateChangedEventArgs.cs
- TCEAdapterGenerator.cs
- WindowsFormsSectionHandler.cs
- XmlCountingReader.cs
- ObjectAssociationEndMapping.cs
- GridViewSortEventArgs.cs
- ServiceOperationWrapper.cs
- LocalValueEnumerator.cs
- VerificationException.cs
- ExcludePathInfo.cs
- _AutoWebProxyScriptHelper.cs
- ProcessInputEventArgs.cs
- EntityParameter.cs
- PassportAuthentication.cs
- ResourceManager.cs
- Certificate.cs
- QueryOutputWriter.cs
- ForwardPositionQuery.cs
- RotationValidation.cs
- MobileControlsSectionHandler.cs
- WpfXamlMember.cs
- Pkcs7Signer.cs
- VarRemapper.cs
- DataGrid.cs
- HttpDictionary.cs
- VirtualPath.cs
- TextCompositionEventArgs.cs
- Fonts.cs
- VBIdentifierDesigner.xaml.cs
- BindingCollection.cs
- SingleObjectCollection.cs
- DataGridViewImageCell.cs
- DeleteBookmarkScope.cs
- CopyNamespacesAction.cs
- DataGridLinkButton.cs
- ThemeableAttribute.cs
- AsymmetricKeyExchangeFormatter.cs
- FloatSumAggregationOperator.cs
- TemplatedAdorner.cs
- OleDbConnectionInternal.cs
- ObjectDataSourceStatusEventArgs.cs
- SizeConverter.cs
- TransactionScope.cs
- XPathNodePointer.cs
- ParentQuery.cs
- Drawing.cs
- ExceptionUtil.cs
- ElementInit.cs
- BamlLocalizer.cs
- PermissionSetTriple.cs
- ChannelDemuxer.cs
- SqlCacheDependency.cs
- BidOverLoads.cs
- TdsParameterSetter.cs
- ContextDataSourceContextData.cs
- FunctionImportElement.cs
- MeshGeometry3D.cs
- ProcessThreadCollection.cs
- ReliableMessagingVersion.cs
- StorageEntityContainerMapping.cs
- PtsPage.cs
- XamlPointCollectionSerializer.cs