Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ThaiBuddhistCalendar.cs
- TrustManagerPromptUI.cs
- DataGridCommandEventArgs.cs
- X509SubjectKeyIdentifierClause.cs
- ResourceKey.cs
- ColorDialog.cs
- WindowVisualStateTracker.cs
- Label.cs
- ParameterToken.cs
- EntityStoreSchemaFilterEntry.cs
- BaseTreeIterator.cs
- HwndStylusInputProvider.cs
- CatalogPartChrome.cs
- ManagedIStream.cs
- SAPIEngineTypes.cs
- CodeDirectiveCollection.cs
- Subset.cs
- _NestedMultipleAsyncResult.cs
- WebPartCollection.cs
- _AuthenticationState.cs
- HandleCollector.cs
- HtmlGenericControl.cs
- DefaultTraceListener.cs
- ColorDialog.cs
- SoapIgnoreAttribute.cs
- SizeFConverter.cs
- StringCollection.cs
- CreateRefExpr.cs
- OraclePermissionAttribute.cs
- ClientConfigurationHost.cs
- XsltLoader.cs
- ExpressionPrefixAttribute.cs
- MetafileEditor.cs
- ComponentRenameEvent.cs
- DocumentationServerProtocol.cs
- ParameterToken.cs
- AssociationType.cs
- WindowsHyperlink.cs
- Track.cs
- TypeValidationEventArgs.cs
- CompiledIdentityConstraint.cs
- RegexMatch.cs
- HighlightComponent.cs
- EntityConnectionStringBuilder.cs
- RootProjectionNode.cs
- Encoder.cs
- CursorEditor.cs
- MimeImporter.cs
- FileSecurity.cs
- GridViewRowPresenter.cs
- DataGridView.cs
- StringUtil.cs
- SHA1CryptoServiceProvider.cs
- UnsafeNativeMethodsPenimc.cs
- LocalizationComments.cs
- ContextMenuAutomationPeer.cs
- SQLDateTimeStorage.cs
- tibetanshape.cs
- EntityTransaction.cs
- ListItemCollection.cs
- DragDropManager.cs
- XmlValueConverter.cs
- PermissionSetEnumerator.cs
- BindMarkupExtensionSerializer.cs
- Floater.cs
- FilteredReadOnlyMetadataCollection.cs
- LayoutEditorPart.cs
- DataGridViewColumnEventArgs.cs
- SocketManager.cs
- ThreadStateException.cs
- SudsWriter.cs
- ContractSearchPattern.cs
- TextContainerChangeEventArgs.cs
- MessageSmuggler.cs
- ForEachAction.cs
- DataBinding.cs
- PropertyIDSet.cs
- DbConnectionPoolCounters.cs
- XmlReader.cs
- CompoundFileIOPermission.cs
- MULTI_QI.cs
- HandlerBase.cs
- Journaling.cs
- FakeModelPropertyImpl.cs
- CodeCatchClause.cs
- LayoutUtils.cs
- MulticastDelegate.cs
- ProcessHostMapPath.cs
- TraceListener.cs
- MemberPath.cs
- RequestDescription.cs
- TreeIterators.cs
- unsafenativemethodstextservices.cs
- SerializableAttribute.cs
- HashSetEqualityComparer.cs
- MessageEventSubscriptionService.cs
- DeferredSelectedIndexReference.cs
- NotifyParentPropertyAttribute.cs
- XmlTextReader.cs
- GridItemProviderWrapper.cs