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
- ContextMenu.cs
- RawStylusInputCustomDataList.cs
- DataGridViewLayoutData.cs
- XmlQuerySequence.cs
- sqlcontext.cs
- DefaultMemberAttribute.cs
- ProcessHostFactoryHelper.cs
- SafeUserTokenHandle.cs
- BezierSegment.cs
- PathSegmentCollection.cs
- ListViewPagedDataSource.cs
- ExecutedRoutedEventArgs.cs
- StringToken.cs
- XmlnsDefinitionAttribute.cs
- ColumnHeaderConverter.cs
- SecUtil.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ContentFilePart.cs
- ExpanderAutomationPeer.cs
- DataDocumentXPathNavigator.cs
- CodeMethodReturnStatement.cs
- CodeAttachEventStatement.cs
- BidPrivateBase.cs
- HwndKeyboardInputProvider.cs
- DataGridViewCellCollection.cs
- ActivityDefaults.cs
- UnsafeNativeMethods.cs
- PtsHost.cs
- WebPartTransformerAttribute.cs
- WSHttpTransportSecurityElement.cs
- HandlerBase.cs
- ToolStripRenderEventArgs.cs
- TextEditorCopyPaste.cs
- HttpBrowserCapabilitiesBase.cs
- FillBehavior.cs
- ReachDocumentSequenceSerializer.cs
- AddInAttribute.cs
- MsmqProcessProtocolHandler.cs
- MethodRental.cs
- LayoutEditorPart.cs
- CqlLexerHelpers.cs
- FontResourceCache.cs
- Message.cs
- CharacterBuffer.cs
- StringConverter.cs
- UInt32.cs
- SchemaObjectWriter.cs
- SQLInt64Storage.cs
- VectorValueSerializer.cs
- TemplateBindingExpression.cs
- NumberFunctions.cs
- WaitHandleCannotBeOpenedException.cs
- SerializerDescriptor.cs
- HashHelper.cs
- ListBox.cs
- ExtensionDataObject.cs
- OrderingQueryOperator.cs
- HttpFileCollectionWrapper.cs
- EntityDataSourceContextCreatingEventArgs.cs
- X509Certificate.cs
- CompositeActivityMarkupSerializer.cs
- TableCellCollection.cs
- RuntimeConfigLKG.cs
- ClientType.cs
- CriticalHandle.cs
- IPEndPointCollection.cs
- _LoggingObject.cs
- RelatedImageListAttribute.cs
- MimeMultiPart.cs
- SequenceNumber.cs
- ResourcePool.cs
- DesignTimeVisibleAttribute.cs
- AddInIpcChannel.cs
- HtmlTableRowCollection.cs
- TableMethodGenerator.cs
- RectAnimationUsingKeyFrames.cs
- Roles.cs
- Fonts.cs
- DbConnectionStringBuilder.cs
- NetTcpSecurity.cs
- ToolStrip.cs
- SqlDataSourceStatusEventArgs.cs
- ServiceContractGenerator.cs
- SafeNativeMethods.cs
- HtmlFormAdapter.cs
- DataViewSetting.cs
- AsymmetricKeyExchangeFormatter.cs
- RIPEMD160.cs
- BooleanAnimationBase.cs
- ToolStripControlHost.cs
- MenuBindingsEditor.cs
- Translator.cs
- SqlConnectionHelper.cs
- ObjectFullSpanRewriter.cs
- __FastResourceComparer.cs
- ToolStripMenuItem.cs
- PreProcessInputEventArgs.cs
- MatrixCamera.cs
- AsyncStreamReader.cs
- LocatorPartList.cs