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
- AndAlso.cs
- mactripleDES.cs
- Evidence.cs
- MarkupCompilePass2.cs
- InfoCardArgumentException.cs
- ComponentResourceKeyConverter.cs
- HotSpotCollection.cs
- Constants.cs
- DateTimeParse.cs
- ExtractorMetadata.cs
- _BasicClient.cs
- LeafCellTreeNode.cs
- IconBitmapDecoder.cs
- XmlWellformedWriterHelpers.cs
- ExtractedStateEntry.cs
- HttpListenerContext.cs
- SqlClientWrapperSmiStream.cs
- UmAlQuraCalendar.cs
- SafeArrayRankMismatchException.cs
- ToolBarButtonClickEvent.cs
- WSDualHttpBindingElement.cs
- CodeAttributeDeclarationCollection.cs
- ProxySimple.cs
- TextParagraphProperties.cs
- DataGridRow.cs
- DomNameTable.cs
- UpdateManifestForBrowserApplication.cs
- FunctionNode.cs
- InputLangChangeRequestEvent.cs
- CodeSnippetCompileUnit.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- FillRuleValidation.cs
- CodeNamespaceImportCollection.cs
- Renderer.cs
- PersonalizationProviderHelper.cs
- BindValidator.cs
- SafeSecurityHandles.cs
- VolatileEnlistmentState.cs
- HotSpot.cs
- ToolStripMenuItem.cs
- MsmqInputChannelListenerBase.cs
- WaitHandleCannotBeOpenedException.cs
- DataGridViewColumnEventArgs.cs
- RC2.cs
- XmlSchemaComplexType.cs
- JapaneseLunisolarCalendar.cs
- IndexedString.cs
- querybuilder.cs
- DSACryptoServiceProvider.cs
- Rotation3D.cs
- HashHelper.cs
- URLAttribute.cs
- HttpException.cs
- MailWriter.cs
- Process.cs
- XmlProcessingInstruction.cs
- HtmlUtf8RawTextWriter.cs
- ListenerConnectionDemuxer.cs
- QilXmlWriter.cs
- TextEmbeddedObject.cs
- listitem.cs
- UnsafeNativeMethods.cs
- Merger.cs
- TransformerInfoCollection.cs
- GeneralTransformCollection.cs
- PageScaling.cs
- ResolveNameEventArgs.cs
- LoadedOrUnloadedOperation.cs
- PowerStatus.cs
- HostingEnvironmentSection.cs
- RightsManagementPermission.cs
- PathGeometry.cs
- AVElementHelper.cs
- Socket.cs
- OracleConnectionString.cs
- ProviderException.cs
- DataGridViewCellLinkedList.cs
- LinqDataSourceUpdateEventArgs.cs
- SymbolTable.cs
- Line.cs
- ISAPIRuntime.cs
- GenericParameterDataContract.cs
- ApplicationServiceManager.cs
- ApplicationSecurityManager.cs
- SqlInternalConnection.cs
- ListViewItem.cs
- webproxy.cs
- MinMaxParagraphWidth.cs
- ConstraintStruct.cs
- SerialReceived.cs
- HttpWriter.cs
- MaterialCollection.cs
- FileIOPermission.cs
- ObjectDataSourceFilteringEventArgs.cs
- ScriptIgnoreAttribute.cs
- WaitHandle.cs
- OperandQuery.cs
- PageCodeDomTreeGenerator.cs
- OleDbMetaDataFactory.cs
- SecurityDocument.cs