Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- UxThemeWrapper.cs
- SqlFormatter.cs
- _NestedMultipleAsyncResult.cs
- ListViewTableRow.cs
- OdbcParameter.cs
- DocumentApplication.cs
- HtmlInputSubmit.cs
- ResourceProviderFactory.cs
- _BufferOffsetSize.cs
- XmlDataSourceDesigner.cs
- MobileControlsSectionHandler.cs
- TableNameAttribute.cs
- WindowsAuthenticationModule.cs
- TreeNodeCollectionEditor.cs
- ViewPort3D.cs
- XPathMultyIterator.cs
- Thread.cs
- TileBrush.cs
- SchemaManager.cs
- UInt32Converter.cs
- _NativeSSPI.cs
- ScriptingSectionGroup.cs
- HttpContext.cs
- COM2ComponentEditor.cs
- ProcessModelInfo.cs
- CustomErrorsSectionWrapper.cs
- AttributedMetaModel.cs
- ServiceOperation.cs
- ImageField.cs
- EpmSourcePathSegment.cs
- MissingMemberException.cs
- Menu.cs
- Light.cs
- DebugView.cs
- CustomError.cs
- StringSource.cs
- CommandTreeTypeHelper.cs
- TaskFileService.cs
- DefaultTraceListener.cs
- typedescriptorpermissionattribute.cs
- Rotation3DKeyFrameCollection.cs
- DataErrorValidationRule.cs
- ConnectionStringsExpressionBuilder.cs
- ControlsConfig.cs
- MessageDirection.cs
- DataServiceQueryContinuation.cs
- KeyManager.cs
- AdapterDictionary.cs
- EditorPartChrome.cs
- ManifestResourceInfo.cs
- RectangleGeometry.cs
- FolderBrowserDialog.cs
- SaveFileDialog.cs
- ButtonBase.cs
- WebHttpEndpoint.cs
- SourceLineInfo.cs
- Soap.cs
- XhtmlBasicCommandAdapter.cs
- CompositeDataBoundControl.cs
- DataTableReader.cs
- ReceiveSecurityHeaderElementManager.cs
- ComplusEndpointConfigContainer.cs
- ViewManager.cs
- ModulesEntry.cs
- rsa.cs
- Transform3DGroup.cs
- TdsParameterSetter.cs
- SafeRegistryHandle.cs
- WorkflowMessageEventArgs.cs
- NewItemsContextMenuStrip.cs
- NameSpaceEvent.cs
- AudioSignalProblemOccurredEventArgs.cs
- ScopedKnownTypes.cs
- XmlAttributeCollection.cs
- WebPartConnectionCollection.cs
- DataGridTablesFactory.cs
- ValueUtilsSmi.cs
- CurrentTimeZone.cs
- OleDbReferenceCollection.cs
- CheckBoxList.cs
- XomlCompilerResults.cs
- LogSwitch.cs
- RequestTimeoutManager.cs
- ParamArrayAttribute.cs
- ZoomPercentageConverter.cs
- ServiceDeploymentInfo.cs
- BulletedListEventArgs.cs
- AppDomainFactory.cs
- WebHostScriptMappingsInstallComponent.cs
- Hashtable.cs
- UpdateTracker.cs
- NativeBuffer.cs
- ByteAnimation.cs
- WindowsStatusBar.cs
- SqlStream.cs
- DataGridViewColumnEventArgs.cs
- TreeChangeInfo.cs
- MailMessageEventArgs.cs
- OpenTypeCommon.cs
- GlyphRunDrawing.cs