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
- SessionEndedEventArgs.cs
- InputManager.cs
- StorageInfo.cs
- FormCollection.cs
- SqlFileStream.cs
- PageThemeParser.cs
- SkipStoryboardToFill.cs
- WebPartConnectionsConnectVerb.cs
- PrivilegeNotHeldException.cs
- BypassElement.cs
- SqlDataSourceCommandEventArgs.cs
- UmAlQuraCalendar.cs
- MonthChangedEventArgs.cs
- Compilation.cs
- PackagePartCollection.cs
- AnnotationResourceChangedEventArgs.cs
- Accessible.cs
- EncryptedKeyIdentifierClause.cs
- BindingExpressionUncommonField.cs
- ValueTypeFixupInfo.cs
- ComboBoxRenderer.cs
- SelectedDatesCollection.cs
- Quad.cs
- NativeMethods.cs
- SqlDataSourceEnumerator.cs
- SecureStringHasher.cs
- Preprocessor.cs
- OutOfProcStateClientManager.cs
- HexParser.cs
- CrossSiteScriptingValidation.cs
- HttpResponse.cs
- DataStreamFromComStream.cs
- NetTcpBinding.cs
- AudioSignalProblemOccurredEventArgs.cs
- LineSegment.cs
- UInt32Storage.cs
- ToolStripSplitStackLayout.cs
- MailAddressParser.cs
- SettingsBindableAttribute.cs
- PageBuildProvider.cs
- ISFClipboardData.cs
- MetadataItem_Static.cs
- Int32Rect.cs
- PropertyGridEditorPart.cs
- Parser.cs
- CodeParameterDeclarationExpression.cs
- UpdateRecord.cs
- PropertyState.cs
- PropertyNames.cs
- WrappingXamlSchemaContext.cs
- AstTree.cs
- StretchValidation.cs
- PersistenceTypeAttribute.cs
- GroupLabel.cs
- MiniLockedBorderGlyph.cs
- Maps.cs
- PkcsUtils.cs
- RenderCapability.cs
- OpCopier.cs
- HttpModuleAction.cs
- Utils.cs
- BamlRecordReader.cs
- SpeechEvent.cs
- PropertyChangeTracker.cs
- LineBreak.cs
- ChangeNode.cs
- Types.cs
- DynamicResourceExtension.cs
- NavigatingCancelEventArgs.cs
- RedirectionProxy.cs
- InvokeHandlers.cs
- ValueProviderWrapper.cs
- CounterCreationDataCollection.cs
- BevelBitmapEffect.cs
- KerberosSecurityTokenParameters.cs
- VirtualizingPanel.cs
- InfoCardKeyedHashAlgorithm.cs
- EventManager.cs
- TabItem.cs
- SafeViewOfFileHandle.cs
- MetaType.cs
- EmbeddedMailObject.cs
- StructuralObject.cs
- ErrorHandlerModule.cs
- SingleSelectRootGridEntry.cs
- EnterpriseServicesHelper.cs
- ThrowHelper.cs
- ClientBuildManager.cs
- WebPartManagerInternals.cs
- Button.cs
- BaseUriWithWildcard.cs
- CapabilitiesSection.cs
- DesignerAutoFormatCollection.cs
- Latin1Encoding.cs
- Parser.cs
- ConditionalAttribute.cs
- LogManagementAsyncResult.cs
- ToolStripArrowRenderEventArgs.cs
- JavaScriptString.cs
- PropertyRecord.cs