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
- TextControlDesigner.cs
- Latin1Encoding.cs
- FillBehavior.cs
- RangeValueProviderWrapper.cs
- MarginCollapsingState.cs
- NativeMethods.cs
- MsmqInputSessionChannel.cs
- RSAPKCS1KeyExchangeFormatter.cs
- AppDomain.cs
- DatasetMethodGenerator.cs
- SourceElementsCollection.cs
- UnsafeMethods.cs
- DataGridTableStyleMappingNameEditor.cs
- MethodRental.cs
- TextSpan.cs
- GreenMethods.cs
- XmlTextEncoder.cs
- InputScopeNameConverter.cs
- XpsSerializationManagerAsync.cs
- FragmentQueryProcessor.cs
- HttpFormatExtensions.cs
- FrameworkContentElement.cs
- DataSourceControlBuilder.cs
- AppDomainProtocolHandler.cs
- EventRecordWrittenEventArgs.cs
- SecurityUniqueId.cs
- Attribute.cs
- TemplateNodeContextMenu.cs
- OracleEncoding.cs
- DependencyPropertyConverter.cs
- RoutedEventValueSerializer.cs
- CollectionChangeEventArgs.cs
- TreeNode.cs
- SoapTypeAttribute.cs
- SecurityTokenReferenceStyle.cs
- ToolStripOverflow.cs
- WebEvents.cs
- TemplateControlParser.cs
- XmlCountingReader.cs
- HTMLTextWriter.cs
- SimplePropertyEntry.cs
- SecurityToken.cs
- StrokeNodeEnumerator.cs
- DataGridViewRowsRemovedEventArgs.cs
- SizeConverter.cs
- DiscreteKeyFrames.cs
- DataKey.cs
- MailWebEventProvider.cs
- MessagingDescriptionAttribute.cs
- ChainedAsyncResult.cs
- WinCategoryAttribute.cs
- IndentedTextWriter.cs
- TableRow.cs
- ActivationServices.cs
- TextBoxAutoCompleteSourceConverter.cs
- ReadOnlyDictionary.cs
- RegistryDataKey.cs
- XmlQuerySequence.cs
- SpanIndex.cs
- CommandHelpers.cs
- EdmPropertyAttribute.cs
- EventLogEntryCollection.cs
- IteratorFilter.cs
- WebEncodingValidator.cs
- WebServiceFaultDesigner.cs
- ReverseInheritProperty.cs
- SaveFileDialog.cs
- ElementNotEnabledException.cs
- UserNamePasswordValidationMode.cs
- XPathSelectionIterator.cs
- WebPartCancelEventArgs.cs
- DictionaryBase.cs
- ErrorActivity.cs
- PrimitiveType.cs
- LayoutEditorPart.cs
- IntegerValidatorAttribute.cs
- RsaSecurityTokenParameters.cs
- ListViewDeletedEventArgs.cs
- WebPartChrome.cs
- BitmapSourceSafeMILHandle.cs
- CodeExporter.cs
- ConstraintStruct.cs
- DataGridViewElement.cs
- ThrowHelper.cs
- SByteConverter.cs
- SqlConnectionString.cs
- CharStorage.cs
- AsmxEndpointPickerExtension.cs
- MenuBase.cs
- Membership.cs
- WorkflowMarkupSerializer.cs
- XmlSchemaType.cs
- XPathScanner.cs
- FullTextLine.cs
- PresentationTraceSources.cs
- TraceUtility.cs
- Lease.cs
- TemplateControlCodeDomTreeGenerator.cs
- XmlFormatMapping.cs
- AvTraceFormat.cs