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
- TransformPattern.cs
- TemplateColumn.cs
- PrimaryKeyTypeConverter.cs
- DrawListViewSubItemEventArgs.cs
- DynamicDataManager.cs
- CategoryGridEntry.cs
- UInt32Converter.cs
- SelectedGridItemChangedEvent.cs
- GrammarBuilderDictation.cs
- SqlExpressionNullability.cs
- DesignerForm.cs
- CombinedGeometry.cs
- ClientProxyGenerator.cs
- ContentPresenter.cs
- PathBox.cs
- TablePattern.cs
- KeyValueConfigurationCollection.cs
- VirtualDirectoryMapping.cs
- CalendarModeChangedEventArgs.cs
- UrlPath.cs
- WebPartUserCapability.cs
- ClientBuildManagerCallback.cs
- TickBar.cs
- BreadCrumbTextConverter.cs
- TypeExtension.cs
- SqlRewriteScalarSubqueries.cs
- HostDesigntimeLicenseContext.cs
- TextEffectCollection.cs
- LayoutManager.cs
- XmlSchemaProviderAttribute.cs
- ContextMenu.cs
- XmlAnyAttributeAttribute.cs
- FlowDocumentPageViewerAutomationPeer.cs
- BinaryNode.cs
- CacheAxisQuery.cs
- DataGridViewCheckBoxColumn.cs
- FastEncoder.cs
- StatusCommandUI.cs
- RightNameExpirationInfoPair.cs
- ToolCreatedEventArgs.cs
- AdRotator.cs
- RightsManagementPermission.cs
- LayoutEvent.cs
- MenuEventArgs.cs
- EndpointNotFoundException.cs
- UndoManager.cs
- CompilerErrorCollection.cs
- SelectedPathEditor.cs
- OleDbParameter.cs
- ErrorFormatter.cs
- PageParserFilter.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- Cloud.cs
- GeometryModel3D.cs
- XamlPathDataSerializer.cs
- XmlSchemaSimpleTypeRestriction.cs
- RayMeshGeometry3DHitTestResult.cs
- RuleSettings.cs
- MenuAutomationPeer.cs
- WindowsGraphicsWrapper.cs
- HttpVersion.cs
- Application.cs
- ObjectDataSourceView.cs
- WSHttpBindingElement.cs
- WindowsEditBox.cs
- ZipIOModeEnforcingStream.cs
- Transform3D.cs
- DocumentationServerProtocol.cs
- base64Transforms.cs
- HtmlTernaryTree.cs
- CommonRemoteMemoryBlock.cs
- LayoutManager.cs
- CompilationPass2Task.cs
- HtmlControlPersistable.cs
- TargetException.cs
- DesignerForm.cs
- NetMsmqSecurityMode.cs
- Config.cs
- StaticTextPointer.cs
- StrongNameMembershipCondition.cs
- AccessText.cs
- ConnectionInterfaceCollection.cs
- Maps.cs
- ErrorBehavior.cs
- SystemWebSectionGroup.cs
- FileSystemWatcher.cs
- VariableAction.cs
- NamespaceCollection.cs
- XNodeNavigator.cs
- Literal.cs
- DictionaryContent.cs
- ExecutionEngineException.cs
- SigningDialog.cs
- OperatorExpressions.cs
- ProfilePropertyMetadata.cs
- RequestNavigateEventArgs.cs
- UIElement3DAutomationPeer.cs
- DataDesignUtil.cs
- ListChunk.cs
- Native.cs