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
- ConstantCheck.cs
- CounterNameConverter.cs
- XPathSelectionIterator.cs
- ServiceModelExtensionElement.cs
- Imaging.cs
- Int32Animation.cs
- Vector.cs
- DecodeHelper.cs
- TraceContext.cs
- EntityWrapperFactory.cs
- LineUtil.cs
- UnknownBitmapEncoder.cs
- BridgeDataReader.cs
- Accessors.cs
- ClientConfigPaths.cs
- LogReservationCollection.cs
- PathFigureCollection.cs
- StringUtil.cs
- SerializationInfoEnumerator.cs
- TypeTypeConverter.cs
- HighContrastHelper.cs
- RowTypeElement.cs
- UrlMappingCollection.cs
- SharingService.cs
- DataTable.cs
- XmlQueryOutput.cs
- SafeNativeMethods.cs
- StrokeNodeEnumerator.cs
- HexParser.cs
- EventLogEntryCollection.cs
- FileDialog_Vista_Interop.cs
- Shape.cs
- HttpResponseHeader.cs
- EntityDataSourceQueryBuilder.cs
- ToolStripDropDownItem.cs
- SqlConnectionString.cs
- TreeView.cs
- ResourceReader.cs
- EntityContainer.cs
- BitmapInitialize.cs
- AutomationPattern.cs
- LocalizabilityAttribute.cs
- WebControl.cs
- SettingsProperty.cs
- DynamicRendererThreadManager.cs
- Margins.cs
- ResXResourceSet.cs
- ReflectTypeDescriptionProvider.cs
- SuppressIldasmAttribute.cs
- WhiteSpaceTrimStringConverter.cs
- NodeCounter.cs
- MarkupProperty.cs
- SyndicationFeed.cs
- SchemaManager.cs
- Point3DAnimationBase.cs
- MULTI_QI.cs
- Events.cs
- EditorAttribute.cs
- MachineKeyConverter.cs
- HierarchicalDataSourceControl.cs
- SplitterDesigner.cs
- MultipleCopiesCollection.cs
- MdbDataFileEditor.cs
- AppearanceEditorPart.cs
- StartUpEventArgs.cs
- SqlParameterCollection.cs
- TableProviderWrapper.cs
- SystemWebSectionGroup.cs
- UnsafeNativeMethods.cs
- ErrorFormatterPage.cs
- InstalledFontCollection.cs
- ExpressionBindings.cs
- PathSegment.cs
- DependencyPropertyKey.cs
- SpecularMaterial.cs
- Rectangle.cs
- LiteralControl.cs
- ComPersistableTypeElement.cs
- BaseInfoTable.cs
- ServiceOperation.cs
- AuthenticationConfig.cs
- UpdateManifestForBrowserApplication.cs
- Accessors.cs
- AppDomain.cs
- PeerNameRecord.cs
- PropertyPath.cs
- RoutedEventConverter.cs
- TimeSpanValidatorAttribute.cs
- ScriptRef.cs
- WebContext.cs
- BuildProviderCollection.cs
- Geometry3D.cs
- TrackingProfileCache.cs
- RawAppCommandInputReport.cs
- CultureTable.cs
- HWStack.cs
- DirectoryNotFoundException.cs
- CellPartitioner.cs
- WebPartZoneCollection.cs
- OrCondition.cs