Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / PropertyInformationCollection.cs / 1305376 / PropertyInformationCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Configuration; using System.Collections.Specialized; using System.ComponentModel; using System.Collections; using System.Runtime.Serialization; using System.Security.Permissions; namespace System.Configuration { // PropertyInformationCollection // // Collection of PropertyInformation objects // [Serializable()] public sealed class PropertyInformationCollection : NameObjectCollectionBase { ConfigurationElement ThisElement = null; internal PropertyInformationCollection(ConfigurationElement thisElement) : base(StringComparer.Ordinal) { ThisElement = thisElement; foreach (ConfigurationProperty prop in ThisElement.Properties) { if (prop.Name != ThisElement.ElementTagName) { BaseAdd(prop.Name, new PropertyInformation(thisElement, prop.Name)); } } IsReadOnly = true; } [SecurityPermissionAttribute(SecurityAction.Demand,SerializationFormatter=true)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); } // Item // // Indexor for retrieving a Property by name // public PropertyInformation this[string propertyName] { get { PropertyInformation result = (PropertyInformation) BaseGet (propertyName); // check for default collection name if (result == null) { PropertyInformation defaultColl = (PropertyInformation) BaseGet (ConfigurationProperty.DefaultCollectionPropertyName); if ((defaultColl != null) && (defaultColl.ProvidedName == propertyName)) { result = defaultColl; } } return result; } } internal PropertyInformation this[int index] { get { return (PropertyInformation)BaseGet(BaseGetKey(index)); } } public void CopyTo(PropertyInformation[] array, int index) { if (array == null) { throw new ArgumentNullException("array"); } if (array.Length < Count + index) { throw new ArgumentOutOfRangeException("index"); } foreach (PropertyInformation pi in this) { array[index++] = pi; } } public override IEnumerator GetEnumerator() { int c = Count; for (int i = 0; i < c; i++) { yield return this[i]; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Configuration; using System.Collections.Specialized; using System.ComponentModel; using System.Collections; using System.Runtime.Serialization; using System.Security.Permissions; namespace System.Configuration { // PropertyInformationCollection // // Collection of PropertyInformation objects // [Serializable()] public sealed class PropertyInformationCollection : NameObjectCollectionBase { ConfigurationElement ThisElement = null; internal PropertyInformationCollection(ConfigurationElement thisElement) : base(StringComparer.Ordinal) { ThisElement = thisElement; foreach (ConfigurationProperty prop in ThisElement.Properties) { if (prop.Name != ThisElement.ElementTagName) { BaseAdd(prop.Name, new PropertyInformation(thisElement, prop.Name)); } } IsReadOnly = true; } [SecurityPermissionAttribute(SecurityAction.Demand,SerializationFormatter=true)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); } // Item // // Indexor for retrieving a Property by name // public PropertyInformation this[string propertyName] { get { PropertyInformation result = (PropertyInformation) BaseGet (propertyName); // check for default collection name if (result == null) { PropertyInformation defaultColl = (PropertyInformation) BaseGet (ConfigurationProperty.DefaultCollectionPropertyName); if ((defaultColl != null) && (defaultColl.ProvidedName == propertyName)) { result = defaultColl; } } return result; } } internal PropertyInformation this[int index] { get { return (PropertyInformation)BaseGet(BaseGetKey(index)); } } public void CopyTo(PropertyInformation[] array, int index) { if (array == null) { throw new ArgumentNullException("array"); } if (array.Length < Count + index) { throw new ArgumentOutOfRangeException("index"); } foreach (PropertyInformation pi in this) { array[index++] = pi; } } public override IEnumerator GetEnumerator() { int c = Count; for (int i = 0; i < c; i++) { yield return this[i]; } } } } // 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
- SafeRegistryHandle.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- Zone.cs
- TextLine.cs
- Mouse.cs
- MultilineStringConverter.cs
- Item.cs
- CounterCreationDataConverter.cs
- GenericUriParser.cs
- AlignmentYValidation.cs
- Int32CollectionValueSerializer.cs
- ExpiredSecurityTokenException.cs
- TreeNodeSelectionProcessor.cs
- ObjectHandle.cs
- TransactionOptions.cs
- TableCell.cs
- Config.cs
- Annotation.cs
- CancellationScope.cs
- ContextActivityUtils.cs
- AnimatedTypeHelpers.cs
- RepeaterItemCollection.cs
- AuditLogLocation.cs
- WebPartManager.cs
- MsmqHostedTransportManager.cs
- ProxyGenerator.cs
- FilterableData.cs
- GridViewRowCollection.cs
- ApplicationServicesHostFactory.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- sqlstateclientmanager.cs
- MessageBox.cs
- DelegatedStream.cs
- DataKey.cs
- RepeatButtonAutomationPeer.cs
- WriteStateInfoBase.cs
- AssemblyBuilderData.cs
- DecryptRequest.cs
- ProviderUtil.cs
- MetadataUtil.cs
- ToolStrip.cs
- BindingList.cs
- DynamicEntity.cs
- TypeConverterMarkupExtension.cs
- SHA1Managed.cs
- AccessDataSource.cs
- grammarelement.cs
- templategroup.cs
- CorePropertiesFilter.cs
- ServiceHostingEnvironment.cs
- QueryReaderSettings.cs
- PresentationAppDomainManager.cs
- ToolStripGrip.cs
- EntryIndex.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- URLMembershipCondition.cs
- CollectionViewProxy.cs
- RegionData.cs
- ItemContainerProviderWrapper.cs
- CompositeTypefaceMetrics.cs
- SponsorHelper.cs
- HttpResponseHeader.cs
- QuaternionValueSerializer.cs
- DesignTimeParseData.cs
- GcSettings.cs
- XmlChildEnumerator.cs
- Property.cs
- ActiveDesignSurfaceEvent.cs
- UpdatePanelControlTrigger.cs
- ExportOptions.cs
- MemberAssignment.cs
- ObfuscateAssemblyAttribute.cs
- TabItemAutomationPeer.cs
- TileModeValidation.cs
- BatchParser.cs
- TreeWalkHelper.cs
- UndoManager.cs
- ComplexObject.cs
- VideoDrawing.cs
- UnmanagedMemoryStream.cs
- ProxyBuilder.cs
- TabRenderer.cs
- ListCollectionView.cs
- ExpressionBuilder.cs
- PackageFilter.cs
- LinqDataSourceContextEventArgs.cs
- MultiByteCodec.cs
- EncryptedType.cs
- RowUpdatedEventArgs.cs
- DataGridViewCheckBoxCell.cs
- IdentifierService.cs
- SeekStoryboard.cs
- BitmapEffectCollection.cs
- AspNetRouteServiceHttpHandler.cs
- X500Name.cs
- DetailsViewDeleteEventArgs.cs
- SmtpReplyReader.cs
- ErrorProvider.cs
- BCLDebug.cs
- WebPartZoneDesigner.cs