Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Configuration / System / Configuration / PropertyInformationCollection.cs / 1 / 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
- Substitution.cs
- COM2Properties.cs
- PageVisual.cs
- LingerOption.cs
- MethodExpression.cs
- Native.cs
- Qualifier.cs
- storepermissionattribute.cs
- ListBoxDesigner.cs
- SID.cs
- MetadataItem.cs
- UidManager.cs
- ObjectSpanRewriter.cs
- IntegerValidatorAttribute.cs
- sortedlist.cs
- RowUpdatingEventArgs.cs
- CompilationUtil.cs
- DesignTable.cs
- PolyBezierSegment.cs
- WebPartManager.cs
- Size3D.cs
- X509InitiatorCertificateClientElement.cs
- DataGridViewCheckBoxColumn.cs
- URLAttribute.cs
- base64Transforms.cs
- HttpTransportElement.cs
- StylusPointCollection.cs
- OpenTypeLayout.cs
- NamespaceMapping.cs
- GridToolTip.cs
- ServiceObjectContainer.cs
- EncoderParameters.cs
- PropertyTabAttribute.cs
- CustomAttributeFormatException.cs
- Thread.cs
- SystemColorTracker.cs
- ConnectionPointCookie.cs
- Directory.cs
- CodeAssignStatement.cs
- SQLInt64.cs
- SafeNativeMethods.cs
- TimeoutStream.cs
- DataTableMappingCollection.cs
- Math.cs
- CaseCqlBlock.cs
- BindingValueChangedEventArgs.cs
- TreeNodeStyleCollection.cs
- SqlUtil.cs
- TimeSpanConverter.cs
- PerspectiveCamera.cs
- ContentPlaceHolder.cs
- ResourceProperty.cs
- JoinCqlBlock.cs
- WindowsImpersonationContext.cs
- DbConnectionPool.cs
- XPathNodeHelper.cs
- WindowsIPAddress.cs
- StateRuntime.cs
- EncoderExceptionFallback.cs
- DataGridViewUtilities.cs
- DesignerActionVerbList.cs
- ServicePoint.cs
- MenuAdapter.cs
- CompilerCollection.cs
- _ProxyChain.cs
- SHA256Managed.cs
- CodeIndexerExpression.cs
- ImmutableCollection.cs
- BindingObserver.cs
- UserInitiatedNavigationPermission.cs
- WorkflowElementDialog.cs
- SplitterEvent.cs
- StrokeDescriptor.cs
- ActivityInstanceReference.cs
- LineVisual.cs
- ExpandCollapseProviderWrapper.cs
- WaitHandle.cs
- StateElement.cs
- BinaryFormatterWriter.cs
- UriSchemeKeyedCollection.cs
- ZoneIdentityPermission.cs
- KeyConstraint.cs
- ServiceDesigner.xaml.cs
- TimeManager.cs
- ShapingEngine.cs
- Attributes.cs
- TripleDES.cs
- RegistrationServices.cs
- ErasingStroke.cs
- DataGridViewRowPostPaintEventArgs.cs
- MatcherBuilder.cs
- DiscoveryEndpointElement.cs
- TabItemAutomationPeer.cs
- RoleGroup.cs
- Figure.cs
- PlacementWorkspace.cs
- BrushMappingModeValidation.cs
- DesignerExtenders.cs
- RegisteredDisposeScript.cs
- SharedStatics.cs