Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / ConfigurationPropertyCollection.cs / 1305376 / 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
- EventSchemaTraceListener.cs
- login.cs
- MediaSystem.cs
- _RequestLifetimeSetter.cs
- RelAssertionDirectKeyIdentifierClause.cs
- MemoryStream.cs
- BStrWrapper.cs
- LicenseProviderAttribute.cs
- GorillaCodec.cs
- FixedSchema.cs
- ObjectQuery_EntitySqlExtensions.cs
- PropertyEmitter.cs
- MetadataArtifactLoaderFile.cs
- DashStyles.cs
- ManipulationInertiaStartingEventArgs.cs
- XamlDesignerSerializationManager.cs
- ScriptRef.cs
- NumericUpDown.cs
- ResourceReferenceExpressionConverter.cs
- Quaternion.cs
- SamlSecurityToken.cs
- DSASignatureFormatter.cs
- OleCmdHelper.cs
- ByteStack.cs
- TcpClientCredentialType.cs
- Atom10FormatterFactory.cs
- DBParameter.cs
- ContractListAdapter.cs
- DataControlCommands.cs
- ToggleProviderWrapper.cs
- WebBrowserPermission.cs
- VectorAnimationBase.cs
- GatewayDefinition.cs
- InitialServerConnectionReader.cs
- StrokeNodeOperations.cs
- MultipartContentParser.cs
- Pair.cs
- PropertyStore.cs
- CapabilitiesUse.cs
- FontResourceCache.cs
- InstalledFontCollection.cs
- XmlCountingReader.cs
- ContourSegment.cs
- DesignerVerb.cs
- DataListItemEventArgs.cs
- PipeStream.cs
- SecUtil.cs
- AutoResetEvent.cs
- XmlEntity.cs
- SchemaImporterExtension.cs
- IIS7WorkerRequest.cs
- MessageDecoder.cs
- ConfigurationSchemaErrors.cs
- ProviderException.cs
- LogicalExpressionEditor.cs
- GridViewUpdatedEventArgs.cs
- SystemUnicastIPAddressInformation.cs
- WinEventWrap.cs
- RowUpdatedEventArgs.cs
- WebServiceClientProxyGenerator.cs
- SchemaTypeEmitter.cs
- FileLevelControlBuilderAttribute.cs
- CustomErrorsSection.cs
- DataGridViewCellCancelEventArgs.cs
- WSSecurityPolicy12.cs
- ThreadAttributes.cs
- X500Name.cs
- HostUtils.cs
- DefaultValueAttribute.cs
- Geometry3D.cs
- XmlExtensionFunction.cs
- ImmComposition.cs
- FormsIdentity.cs
- StringValidatorAttribute.cs
- IEnumerable.cs
- ACE.cs
- AsnEncodedData.cs
- CompatibleIComparer.cs
- CompilationUtil.cs
- _NegoStream.cs
- ChannelReliableSession.cs
- BamlLocalizabilityResolver.cs
- DiscoveryExceptionDictionary.cs
- XmlSchemaDatatype.cs
- ColorConvertedBitmap.cs
- ErrorView.xaml.cs
- GenericEnumConverter.cs
- ActivationProxy.cs
- RegexCompiler.cs
- ApplicationHost.cs
- SetStoryboardSpeedRatio.cs
- XPathAncestorIterator.cs
- FocusChangedEventArgs.cs
- BufferedStream.cs
- DecoderExceptionFallback.cs
- XmlUtilWriter.cs
- AsyncResult.cs
- RangeValueProviderWrapper.cs
- FixedLineResult.cs
- UtilityExtension.cs