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
- OleDbRowUpdatedEvent.cs
- ImageDrawing.cs
- IPAddressCollection.cs
- TemplateBindingExtension.cs
- KeyValuePair.cs
- ProtectedConfigurationSection.cs
- UpDownEvent.cs
- ExtractedStateEntry.cs
- BoundConstants.cs
- SmiEventSink_Default.cs
- BufferAllocator.cs
- ColorTransform.cs
- LineSegment.cs
- SizeChangedEventArgs.cs
- KnownTypesProvider.cs
- IndexedGlyphRun.cs
- ScriptComponentDescriptor.cs
- StyleTypedPropertyAttribute.cs
- TrackingConditionCollection.cs
- AppDomainEvidenceFactory.cs
- ControlOperationBehavior.cs
- CompleteWizardStep.cs
- CompilationUnit.cs
- BitmapDownload.cs
- PlanCompiler.cs
- CursorConverter.cs
- EnumUnknown.cs
- DecoderFallbackWithFailureFlag.cs
- CodeTypeParameterCollection.cs
- ControlPaint.cs
- StyleSelector.cs
- XmlSortKey.cs
- LinkedResource.cs
- CheckedListBox.cs
- SelectionPattern.cs
- LinearGradientBrush.cs
- DirectionalLight.cs
- WindowsListViewItemStartMenu.cs
- LocationReferenceEnvironment.cs
- BaseValidator.cs
- SelectingProviderEventArgs.cs
- ExtractorMetadata.cs
- ExpandedWrapper.cs
- ErrorFormatter.cs
- TextSelection.cs
- DataGridItemEventArgs.cs
- OleDbSchemaGuid.cs
- AnimatedTypeHelpers.cs
- DelayedRegex.cs
- WorkflowQueuingService.cs
- RangeExpression.cs
- TaiwanLunisolarCalendar.cs
- EndpointDispatcherTable.cs
- HierarchicalDataBoundControl.cs
- StreamGeometryContext.cs
- DependencyPropertyValueSerializer.cs
- Property.cs
- Stacktrace.cs
- ConvertEvent.cs
- LogEntrySerializer.cs
- TrackingStringDictionary.cs
- TextWriter.cs
- AutomationProperty.cs
- NavigationPropertyEmitter.cs
- ListChangedEventArgs.cs
- DataGridViewImageColumn.cs
- DurableInstanceProvider.cs
- ObjectViewQueryResultData.cs
- TableStyle.cs
- DataSourceControlBuilder.cs
- ControlIdConverter.cs
- bindurihelper.cs
- SplineQuaternionKeyFrame.cs
- ColorConverter.cs
- PrintDialogDesigner.cs
- LongValidator.cs
- BooleanFunctions.cs
- XmlAttributeOverrides.cs
- PathFigureCollectionConverter.cs
- HostSecurityManager.cs
- ImageFormatConverter.cs
- KeyPullup.cs
- __Error.cs
- WindowsGraphics2.cs
- BitmapEffectGeneralTransform.cs
- RefreshEventArgs.cs
- UriScheme.cs
- Transactions.cs
- ManagedFilter.cs
- EditorOptionAttribute.cs
- PropertyPushdownHelper.cs
- XmlSchemaSequence.cs
- MatrixStack.cs
- CapacityStreamGeometryContext.cs
- StringFreezingAttribute.cs
- TdsParserHelperClasses.cs
- EnumConverter.cs
- parserscommon.cs
- CommandHelpers.cs
- EventWaitHandle.cs