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
- Int64KeyFrameCollection.cs
- DBSqlParserTableCollection.cs
- TypeSystemHelpers.cs
- InstanceStore.cs
- XmlArrayAttribute.cs
- IUnknownConstantAttribute.cs
- SystemResourceKey.cs
- CheckBox.cs
- XmlArrayAttribute.cs
- TextTabProperties.cs
- StringInfo.cs
- ServiceDescription.cs
- EventTrigger.cs
- Rfc2898DeriveBytes.cs
- RtfToXamlReader.cs
- XmlnsDefinitionAttribute.cs
- XmlNullResolver.cs
- login.cs
- FrameworkContentElement.cs
- ProxyWebPartConnectionCollection.cs
- DeferredReference.cs
- AssemblySettingAttributes.cs
- SplitterCancelEvent.cs
- ReachSerializableProperties.cs
- SectionInput.cs
- KeyInfo.cs
- PtsHost.cs
- PartialClassGenerationTask.cs
- DocumentGridContextMenu.cs
- TiffBitmapEncoder.cs
- ParserHooks.cs
- StructuredTypeEmitter.cs
- SapiRecoContext.cs
- SelectManyQueryOperator.cs
- GridEntry.cs
- CancellationTokenSource.cs
- DeploymentSection.cs
- GatewayIPAddressInformationCollection.cs
- ExclusiveHandle.cs
- DelimitedListTraceListener.cs
- Soap.cs
- XmlWhitespace.cs
- FunctionDetailsReader.cs
- PromptStyle.cs
- DNS.cs
- PersonalizationStateInfo.cs
- EmptyImpersonationContext.cs
- StringArrayEditor.cs
- WpfGeneratedKnownProperties.cs
- ModelEditingScope.cs
- UnsafeMethods.cs
- DirectionalLight.cs
- GeneralTransform3DGroup.cs
- ScriptingSectionGroup.cs
- WindowsFormsEditorServiceHelper.cs
- RequestCacheEntry.cs
- SiteMapNodeCollection.cs
- SeekStoryboard.cs
- ListViewDataItem.cs
- SignedPkcs7.cs
- TypeLoadException.cs
- ScriptResourceHandler.cs
- AccessibilityApplicationManager.cs
- RecordConverter.cs
- MarkupWriter.cs
- DbDataAdapter.cs
- InlineCollection.cs
- _ConnectOverlappedAsyncResult.cs
- TextElementEnumerator.cs
- CodeConstructor.cs
- DataControlFieldCell.cs
- TrustSection.cs
- DefaultValueConverter.cs
- ContextMenuStrip.cs
- EdmSchemaError.cs
- _FixedSizeReader.cs
- GradientBrush.cs
- DPTypeDescriptorContext.cs
- PropVariant.cs
- CapiSafeHandles.cs
- QuaternionRotation3D.cs
- EdmValidator.cs
- Attribute.cs
- ConfigXmlElement.cs
- TextEffectCollection.cs
- FixedSOMTable.cs
- XmlWrappingWriter.cs
- ApplyImportsAction.cs
- PathFigure.cs
- DataKey.cs
- DataFieldConverter.cs
- WCFServiceClientProxyGenerator.cs
- SiteMapNode.cs
- PageAction.cs
- SetUserLanguageRequest.cs
- TextServicesContext.cs
- MdiWindowListStrip.cs
- CodeLabeledStatement.cs
- ProfileSettings.cs
- SelfIssuedAuthProofToken.cs