Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / UIAutomation / UIAutomationClient / System / Windows / Automation / AutomationElementCollection.cs / 1 / AutomationElementCollection.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Read-only collection of AutomationElements - effectively a // wrapper for Array // // History: // 03/08/2004 : BrendanM - Created // //--------------------------------------------------------------------------- using System; using System.Collections; using MS.Internal.Automation; namespace System.Windows.Automation { ////// A read-only collection of AutomationElement objects /// #if (INTERNAL_COMPILE) internal class AutomationElementCollection: ICollection #else public class AutomationElementCollection: ICollection #endif { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors internal AutomationElementCollection(AutomationElement[] elements) { _elements = elements; } #endregion Constructors //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- #region Public Properties ////// Returns the specified item in this collection /// public AutomationElement this[int index] { get { return _elements[ index ]; } } #endregion Public Properties //------------------------------------------------------ // // Interface ICollection // //------------------------------------------------------ #region Interface ICollection ////// Copies all the elements of the current collection to the specified one-dimensional Array. /// public virtual void CopyTo( Array array, int index ) { _elements.CopyTo( array, index ); } ////// Copies all the elements of the current collection to the specified one-dimensional Array. /// public void CopyTo(AutomationElement[] array, int index) { ((ICollection)this).CopyTo(array, index); } ////// Returns the number of elements in this collection /// public int Count { get { return _elements.Length; } } ////// Gets an object that can be used to synchronize access to the collection. /// public virtual Object SyncRoot { get { // Don't return _elements.SyncRoot, since that may leak a reference to the array, // allowing it to be modified. return this; } } ////// Gets a value indicating whether access to the collection is synchronized (thread-safe). /// public virtual bool IsSynchronized { get { return false; } } ////// Returns an IEnumerator for the collection /// public IEnumerator GetEnumerator() { return _elements.GetEnumerator(); } #endregion Interface ICollection //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private AutomationElement[] _elements; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Read-only collection of AutomationElements - effectively a // wrapper for Array // // History: // 03/08/2004 : BrendanM - Created // //--------------------------------------------------------------------------- using System; using System.Collections; using MS.Internal.Automation; namespace System.Windows.Automation { ////// A read-only collection of AutomationElement objects /// #if (INTERNAL_COMPILE) internal class AutomationElementCollection: ICollection #else public class AutomationElementCollection: ICollection #endif { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors internal AutomationElementCollection(AutomationElement[] elements) { _elements = elements; } #endregion Constructors //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- #region Public Properties ////// Returns the specified item in this collection /// public AutomationElement this[int index] { get { return _elements[ index ]; } } #endregion Public Properties //------------------------------------------------------ // // Interface ICollection // //------------------------------------------------------ #region Interface ICollection ////// Copies all the elements of the current collection to the specified one-dimensional Array. /// public virtual void CopyTo( Array array, int index ) { _elements.CopyTo( array, index ); } ////// Copies all the elements of the current collection to the specified one-dimensional Array. /// public void CopyTo(AutomationElement[] array, int index) { ((ICollection)this).CopyTo(array, index); } ////// Returns the number of elements in this collection /// public int Count { get { return _elements.Length; } } ////// Gets an object that can be used to synchronize access to the collection. /// public virtual Object SyncRoot { get { // Don't return _elements.SyncRoot, since that may leak a reference to the array, // allowing it to be modified. return this; } } ////// Gets a value indicating whether access to the collection is synchronized (thread-safe). /// public virtual bool IsSynchronized { get { return false; } } ////// Returns an IEnumerator for the collection /// public IEnumerator GetEnumerator() { return _elements.GetEnumerator(); } #endregion Interface ICollection //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private AutomationElement[] _elements; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PageOrientation.cs
- BamlTreeUpdater.cs
- ProtocolsConfigurationEntry.cs
- StructuralType.cs
- DataGrid.cs
- BaseDataBoundControlDesigner.cs
- ProfileService.cs
- Bidi.cs
- DataGridViewSelectedRowCollection.cs
- ConfigurationSection.cs
- DrawingCollection.cs
- MailMessage.cs
- TableColumnCollection.cs
- ConfigurationPropertyAttribute.cs
- DBSqlParserTableCollection.cs
- webproxy.cs
- EntityDataSourceValidationException.cs
- ISFTagAndGuidCache.cs
- Object.cs
- EditBehavior.cs
- BrowserDefinitionCollection.cs
- HashCodeCombiner.cs
- FormCollection.cs
- SchemaNames.cs
- XmlName.cs
- WsatServiceCertificate.cs
- MultiTargetingUtil.cs
- SQLMoney.cs
- HttpPostedFileBase.cs
- HideDisabledControlAdapter.cs
- ArrangedElement.cs
- ClientEventManager.cs
- BindingElementExtensionElement.cs
- DynamicFilter.cs
- DragEventArgs.cs
- RoleGroupCollection.cs
- HostProtectionException.cs
- PathFigureCollectionConverter.cs
- NegotiateStream.cs
- XsltFunctions.cs
- ContentElementAutomationPeer.cs
- AutomationPatternInfo.cs
- Image.cs
- SerializableAttribute.cs
- ControlOperationInvoker.cs
- ListItemCollection.cs
- ObjectToken.cs
- ObjectDataSourceMethodEventArgs.cs
- DetailsViewPagerRow.cs
- LineSegment.cs
- CrossSiteScriptingValidation.cs
- EntityContainerEntitySetDefiningQuery.cs
- KeyValuePair.cs
- dataprotectionpermission.cs
- ProtocolsConfigurationEntry.cs
- TextServicesManager.cs
- SoapObjectWriter.cs
- Sql8ConformanceChecker.cs
- RMPublishingDialog.cs
- COM2AboutBoxPropertyDescriptor.cs
- ValueExpressions.cs
- GeometryModel3D.cs
- WindowsListViewItemStartMenu.cs
- GC.cs
- ForceCopyBuildProvider.cs
- WaitForChangedResult.cs
- StorageFunctionMapping.cs
- Collection.cs
- XamlGridLengthSerializer.cs
- DbFunctionCommandTree.cs
- XmlSchemaNotation.cs
- XamlParser.cs
- PointIndependentAnimationStorage.cs
- RegexStringValidator.cs
- OutputScopeManager.cs
- FixedPageProcessor.cs
- TransactionProtocolConverter.cs
- ClaimTypeRequirement.cs
- DynamicQueryableWrapper.cs
- ExceptQueryOperator.cs
- TypeInfo.cs
- PersonalizationStateQuery.cs
- WeakHashtable.cs
- MinMaxParagraphWidth.cs
- PeerInvitationResponse.cs
- EntityConnectionStringBuilder.cs
- SiteIdentityPermission.cs
- AssemblyResourceLoader.cs
- arabicshape.cs
- ApplicationSecurityInfo.cs
- SafeRightsManagementEnvironmentHandle.cs
- Model3DCollection.cs
- DefaultTraceListener.cs
- ApplicationFileParser.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- XmlDeclaration.cs
- DoubleCollectionValueSerializer.cs
- ListItemConverter.cs
- SqlGenericUtil.cs
- DataListGeneralPage.cs