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
- DateTimeConverter2.cs
- XmlValidatingReaderImpl.cs
- FrameworkElementFactory.cs
- DataGridViewRowHeaderCell.cs
- LayoutUtils.cs
- QilScopedVisitor.cs
- MatchingStyle.cs
- IERequestCache.cs
- DbExpressionVisitor.cs
- DrawingImage.cs
- InputScope.cs
- CellConstant.cs
- DataGridHeaderBorder.cs
- QilTargetType.cs
- MouseActionValueSerializer.cs
- CompensatableTransactionScopeActivityDesigner.cs
- WindowsTab.cs
- DataServiceKeyAttribute.cs
- DropShadowEffect.cs
- SvcFileManager.cs
- DataPointer.cs
- CodeLabeledStatement.cs
- Exceptions.cs
- SpinLock.cs
- QueryAsyncResult.cs
- XmlSerializerVersionAttribute.cs
- CustomAttributeSerializer.cs
- XsltSettings.cs
- PanelStyle.cs
- SplayTreeNode.cs
- ParseNumbers.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- ListViewPagedDataSource.cs
- BaseTemplateParser.cs
- AnonymousIdentificationSection.cs
- ValidateNames.cs
- TypefaceCollection.cs
- CLSCompliantAttribute.cs
- SqlCachedBuffer.cs
- WebBaseEventKeyComparer.cs
- SqlInternalConnectionSmi.cs
- EntityDataSourceWizardForm.cs
- DesignerMetadata.cs
- ConnectionManagementSection.cs
- Compiler.cs
- GlyphsSerializer.cs
- CharConverter.cs
- WindowVisualStateTracker.cs
- _emptywebproxy.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- SchemaObjectWriter.cs
- RemotingConfiguration.cs
- SystemKeyConverter.cs
- HandlerBase.cs
- SerializationAttributes.cs
- ProfileWorkflowElement.cs
- EUCJPEncoding.cs
- NameValueFileSectionHandler.cs
- AccessorTable.cs
- GeneralTransform2DTo3D.cs
- SqlRewriteScalarSubqueries.cs
- XmlMemberMapping.cs
- WmlPageAdapter.cs
- XDRSchema.cs
- DynamicPropertyHolder.cs
- TableLayoutCellPaintEventArgs.cs
- PassportAuthentication.cs
- PropertyValidationContext.cs
- OleDbConnectionInternal.cs
- MemberAccessException.cs
- DataTableReaderListener.cs
- Int64KeyFrameCollection.cs
- TextTreeUndo.cs
- ScrollBarAutomationPeer.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- FixedDocumentSequencePaginator.cs
- AttachedPropertyDescriptor.cs
- Run.cs
- CapabilitiesRule.cs
- ReadOnlyDictionary.cs
- TextPointer.cs
- TypeViewSchema.cs
- KeyedHashAlgorithm.cs
- ButtonBaseAutomationPeer.cs
- SpecialNameAttribute.cs
- SqlDataSourceQueryEditor.cs
- TreeViewItemAutomationPeer.cs
- SignatureHelper.cs
- HandleTable.cs
- RegexParser.cs
- TextTrailingCharacterEllipsis.cs
- DiagnosticEventProvider.cs
- SerialPinChanges.cs
- ToolStripButton.cs
- Point3DAnimation.cs
- FrameworkReadOnlyPropertyMetadata.cs
- AnonymousIdentificationModule.cs
- TraceSwitch.cs
- ParallelActivityDesigner.cs
- ButtonRenderer.cs