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
- LayoutManager.cs
- ClientUrlResolverWrapper.cs
- ColumnTypeConverter.cs
- recordstatescratchpad.cs
- RoutedEvent.cs
- CorrelationQuery.cs
- WsiProfilesElementCollection.cs
- ToolboxItemImageConverter.cs
- ThreadExceptionDialog.cs
- TemplateNameScope.cs
- DateTimeConverter.cs
- ISO2022Encoding.cs
- SafeBitVector32.cs
- MethodToken.cs
- JsonReaderDelegator.cs
- OleAutBinder.cs
- HttpClientCertificate.cs
- WinEventHandler.cs
- FunctionDetailsReader.cs
- ParserExtension.cs
- SqlConnection.cs
- ConditionedDesigner.cs
- ZipIOCentralDirectoryBlock.cs
- log.cs
- XsltException.cs
- RelationshipNavigation.cs
- CacheDict.cs
- StreamWriter.cs
- VerificationAttribute.cs
- ImageClickEventArgs.cs
- TraceProvider.cs
- EventToken.cs
- brushes.cs
- SystemResources.cs
- VisualStyleRenderer.cs
- HitTestWithGeometryDrawingContextWalker.cs
- AsyncInvokeOperation.cs
- LineBreakRecord.cs
- GetMemberBinder.cs
- Wildcard.cs
- FloatSumAggregationOperator.cs
- CustomAssemblyResolver.cs
- PiiTraceSource.cs
- SeverityFilter.cs
- TableCell.cs
- RegisteredHiddenField.cs
- XmlWhitespace.cs
- DataObjectAttribute.cs
- HwndSource.cs
- TriggerBase.cs
- SoapEnumAttribute.cs
- TextServicesHost.cs
- NullRuntimeConfig.cs
- SHA384Managed.cs
- CodeDelegateCreateExpression.cs
- ColumnResizeUndoUnit.cs
- StreamReader.cs
- HwndSourceParameters.cs
- RoleServiceManager.cs
- DataException.cs
- XmlSchemaSimpleTypeUnion.cs
- RealProxy.cs
- SecureUICommand.cs
- RangeValidator.cs
- SoapRpcMethodAttribute.cs
- FramingDecoders.cs
- LightweightEntityWrapper.cs
- SemanticValue.cs
- ScriptMethodAttribute.cs
- TextPattern.cs
- BamlTreeNode.cs
- GetWinFXPath.cs
- SoapExtensionTypeElement.cs
- SiteMapHierarchicalDataSourceView.cs
- PartitionResolver.cs
- ToolboxDataAttribute.cs
- WebOperationContext.cs
- OutOfMemoryException.cs
- PropertyMapper.cs
- GroupPartitionExpr.cs
- CustomErrorsSection.cs
- WebPartVerb.cs
- DataGridPagerStyle.cs
- Line.cs
- unitconverter.cs
- WebPartMenuStyle.cs
- MaterialGroup.cs
- ColorTransformHelper.cs
- ReachSerializationUtils.cs
- SoapMessage.cs
- XmlSchemaIdentityConstraint.cs
- XmlSequenceWriter.cs
- ExtensionDataReader.cs
- BitmapEffectInput.cs
- TemplatePagerField.cs
- XmlElementElementCollection.cs
- ConnectionPoint.cs
- PreviewPageInfo.cs
- SqlBooleanMismatchVisitor.cs
- DiffuseMaterial.cs