Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- XamlFilter.cs
- DBNull.cs
- ConfigUtil.cs
- ButtonPopupAdapter.cs
- TextBoxAutomationPeer.cs
- MenuItemStyle.cs
- PointLight.cs
- TemplatePagerField.cs
- ResourcesGenerator.cs
- MsmqIntegrationSecurityMode.cs
- StickyNoteHelper.cs
- Constants.cs
- BoundingRectTracker.cs
- XmlDataSourceDesigner.cs
- SqlSupersetValidator.cs
- MarkupExtensionReturnTypeAttribute.cs
- SchemaEntity.cs
- TextPointerBase.cs
- PropertyContainer.cs
- Metadata.cs
- BookmarkManager.cs
- PixelFormats.cs
- AuthenticationException.cs
- ClonableStack.cs
- Boolean.cs
- AvtEvent.cs
- DiffuseMaterial.cs
- ReadOnlyDictionary.cs
- MsmqBindingElementBase.cs
- XmlSerializationReader.cs
- PrivateFontCollection.cs
- LambdaCompiler.ControlFlow.cs
- EntityDataSourceSelectingEventArgs.cs
- HtmlInputFile.cs
- TailPinnedEventArgs.cs
- DataColumnChangeEvent.cs
- DrawingCollection.cs
- ThumbAutomationPeer.cs
- DbDataAdapter.cs
- FreezableOperations.cs
- LinqDataSourceStatusEventArgs.cs
- UnsafeNativeMethods.cs
- SmiEventSink.cs
- WorkflowMarkupSerializationProvider.cs
- ToolStripArrowRenderEventArgs.cs
- PhysicalAddress.cs
- CodeExporter.cs
- Byte.cs
- BitmapMetadataBlob.cs
- WsdlBuildProvider.cs
- ToolStripButton.cs
- MSHTMLHost.cs
- _UncName.cs
- FixedStringLookup.cs
- BuildProvider.cs
- FacetDescription.cs
- UnicastIPAddressInformationCollection.cs
- Button.cs
- X500Name.cs
- FileLoadException.cs
- EditorZone.cs
- NativeDirectoryServicesQueryAPIs.cs
- DrawTreeNodeEventArgs.cs
- HwndStylusInputProvider.cs
- DataViewManagerListItemTypeDescriptor.cs
- ResourceBinder.cs
- NameValuePermission.cs
- MarshalDirectiveException.cs
- TextRangeBase.cs
- WSHttpSecurityElement.cs
- Oid.cs
- Types.cs
- TextMetrics.cs
- FormViewDeletedEventArgs.cs
- DocumentViewerAutomationPeer.cs
- SettingsProperty.cs
- WebEncodingValidator.cs
- CannotUnloadAppDomainException.cs
- HandleDictionary.cs
- ZipIORawDataFileBlock.cs
- StsCommunicationException.cs
- CheckableControlBaseAdapter.cs
- DesigntimeLicenseContextSerializer.cs
- XmlDataProvider.cs
- SafeNativeMethodsOther.cs
- BaseDataBoundControl.cs
- PageThemeParser.cs
- Pair.cs
- Request.cs
- OperationAbortedException.cs
- TransactionTraceIdentifier.cs
- ProcessHostServerConfig.cs
- LongValidatorAttribute.cs
- Errors.cs
- SamlEvidence.cs
- AttributedMetaModel.cs
- DesignerRegion.cs
- DictionarySurrogate.cs
- FastPropertyAccessor.cs
- EndEvent.cs