Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / UIAutomation / UIAutomationClient / System / Windows / Automation / AutomationElementCollection.cs / 1305600 / 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
- StreamGeometryContext.cs
- ImageCodecInfoPrivate.cs
- TextCompositionEventArgs.cs
- DataGridViewEditingControlShowingEventArgs.cs
- TextRangeAdaptor.cs
- wgx_exports.cs
- Utils.cs
- LinqDataSourceView.cs
- TargetInvocationException.cs
- TraceContextEventArgs.cs
- FullTextBreakpoint.cs
- MediaCommands.cs
- ArcSegment.cs
- ConfigXmlAttribute.cs
- ProcessThreadDesigner.cs
- WorkflowView.cs
- QueryContinueDragEvent.cs
- _OSSOCK.cs
- Misc.cs
- COM2TypeInfoProcessor.cs
- EditableTreeList.cs
- TransformProviderWrapper.cs
- UpdatePanelTrigger.cs
- TextSelectionHighlightLayer.cs
- EFDataModelProvider.cs
- SQLInt16Storage.cs
- AccessibleObject.cs
- LineSegment.cs
- FixedPageAutomationPeer.cs
- SegmentInfo.cs
- ClientSession.cs
- SqlProviderServices.cs
- TextServicesLoader.cs
- ClientRolePrincipal.cs
- SinglePageViewer.cs
- BlobPersonalizationState.cs
- ListViewCancelEventArgs.cs
- PageParserFilter.cs
- CompositeDataBoundControl.cs
- SqlTriggerContext.cs
- LinqMaximalSubtreeNominator.cs
- FeatureSupport.cs
- ToolTip.cs
- ValueQuery.cs
- DataGridViewCellCollection.cs
- ListViewItem.cs
- EntitySqlQueryCacheKey.cs
- RequestBringIntoViewEventArgs.cs
- shaperfactory.cs
- CacheRequest.cs
- Table.cs
- BeginStoryboard.cs
- MetadataPropertyCollection.cs
- DoubleLink.cs
- RootProfilePropertySettingsCollection.cs
- LoopExpression.cs
- WinInet.cs
- SQLStringStorage.cs
- StatusStrip.cs
- storepermissionattribute.cs
- ActivityDesignerAccessibleObject.cs
- EntityDataSourceContextCreatingEventArgs.cs
- SafeNativeMethodsOther.cs
- TagPrefixAttribute.cs
- DesignerTextWriter.cs
- SafeHandles.cs
- PropertyRef.cs
- ValidatorCollection.cs
- BrowserCapabilitiesFactoryBase.cs
- Wizard.cs
- RotateTransform3D.cs
- SafeEventLogReadHandle.cs
- FileDialog_Vista_Interop.cs
- StreamWriter.cs
- OciEnlistContext.cs
- MultiSelectRootGridEntry.cs
- WebPartCatalogAddVerb.cs
- SqlXml.cs
- Point3DAnimationBase.cs
- SqlDataSourceFilteringEventArgs.cs
- InternalControlCollection.cs
- TypedColumnHandler.cs
- ISCIIEncoding.cs
- DbProviderManifest.cs
- RadialGradientBrush.cs
- HierarchicalDataSourceIDConverter.cs
- TableRowGroupCollection.cs
- BulletChrome.cs
- WebBrowserNavigatedEventHandler.cs
- RuleDefinitions.cs
- MultitargetingHelpers.cs
- FrameworkTemplate.cs
- UIElement.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs
- ThreadAttributes.cs
- TimeManager.cs
- ToolBarButtonClickEvent.cs
- GradientBrush.cs
- XmlQueryContext.cs
- AvtEvent.cs