Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ManagementOperationWatcher.cs
- CodeIndexerExpression.cs
- SignedXmlDebugLog.cs
- XhtmlConformanceSection.cs
- SimpleTypeResolver.cs
- DescendantOverDescendantQuery.cs
- ActionFrame.cs
- SQLBinary.cs
- QilTypeChecker.cs
- InkCanvasInnerCanvas.cs
- Logging.cs
- ValidationSummary.cs
- ExternalException.cs
- CompModSwitches.cs
- RegistryPermission.cs
- EditorZoneDesigner.cs
- EncryptedData.cs
- MyContact.cs
- UInt16Storage.cs
- precedingquery.cs
- PointConverter.cs
- NullableLongAverageAggregationOperator.cs
- TextParaClient.cs
- DataTableMapping.cs
- WebPartUtil.cs
- ResourcePool.cs
- NoneExcludedImageIndexConverter.cs
- BitConverter.cs
- CustomCredentialPolicy.cs
- IsolatedStoragePermission.cs
- RSAPKCS1KeyExchangeFormatter.cs
- PagesSection.cs
- StringExpressionSet.cs
- CompositeFontParser.cs
- HttpContextServiceHost.cs
- ImageSourceConverter.cs
- XmlNode.cs
- EastAsianLunisolarCalendar.cs
- DragEventArgs.cs
- CqlGenerator.cs
- XhtmlBasicTextViewAdapter.cs
- SchemaTypeEmitter.cs
- Executor.cs
- XhtmlBasicSelectionListAdapter.cs
- RecognizedPhrase.cs
- XmlSchemaImport.cs
- WinOEToolBoxItem.cs
- QuaternionRotation3D.cs
- ParserExtension.cs
- XmlSchemaAll.cs
- DataContractSerializerMessageContractImporter.cs
- BevelBitmapEffect.cs
- ScrollBarRenderer.cs
- NumberAction.cs
- Rectangle.cs
- Helper.cs
- SQLCharsStorage.cs
- Keywords.cs
- ApplicationInfo.cs
- OletxEnlistment.cs
- SystemShuttingDownException.cs
- DocumentOutline.cs
- CompiledIdentityConstraint.cs
- InkCanvas.cs
- PropertyTabChangedEvent.cs
- PenThread.cs
- RemotingConfigParser.cs
- XmlDataImplementation.cs
- DataGridViewTextBoxColumn.cs
- FileUpload.cs
- WindowsEditBoxRange.cs
- CompModSwitches.cs
- TranslateTransform3D.cs
- GridViewCancelEditEventArgs.cs
- SuppressMergeCheckAttribute.cs
- Internal.cs
- FrameworkContextData.cs
- ValidatingReaderNodeData.cs
- SchemaTableOptionalColumn.cs
- UidPropertyAttribute.cs
- TextViewElement.cs
- RemotingException.cs
- SafeRightsManagementHandle.cs
- FilteredDataSetHelper.cs
- FileLogRecordStream.cs
- ExtentKey.cs
- LogicalTreeHelper.cs
- MediaTimeline.cs
- ConfigXmlComment.cs
- WorkflowTraceTransfer.cs
- ButtonChrome.cs
- SessionParameter.cs
- PageContentAsyncResult.cs
- InvokeWebService.cs
- WebPartConnectionsCancelEventArgs.cs
- OperatingSystem.cs
- ArgumentNullException.cs
- Utils.cs
- XmlSerializerSection.cs
- ListControlConvertEventArgs.cs