Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- SafeRegistryHandle.cs
- SqlAliasesReferenced.cs
- QueryMath.cs
- KeyedCollection.cs
- UIElement3D.cs
- ADMembershipUser.cs
- MimePart.cs
- FileLevelControlBuilderAttribute.cs
- RelationshipConverter.cs
- PermissionToken.cs
- CompositeDataBoundControl.cs
- ReferencedCollectionType.cs
- IEnumerable.cs
- ModuleBuilderData.cs
- MetadataHelper.cs
- FileDialog_Vista_Interop.cs
- WebPartZone.cs
- ContextQuery.cs
- BasicDesignerLoader.cs
- DependencyProperty.cs
- PackUriHelper.cs
- WorkflowWebService.cs
- TypeConverterHelper.cs
- SafeWaitHandle.cs
- Matrix.cs
- ImageDrawing.cs
- Converter.cs
- MessageBox.cs
- MessageDecoder.cs
- BamlLocalizer.cs
- Attachment.cs
- Page.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- XmlDocumentSerializer.cs
- EffectiveValueEntry.cs
- SQLBinaryStorage.cs
- GuidelineSet.cs
- SoapMessage.cs
- EventLogPermissionEntryCollection.cs
- dbdatarecord.cs
- NullPackagingPolicy.cs
- DelayedRegex.cs
- OdbcPermission.cs
- OracleColumn.cs
- TransformValueSerializer.cs
- VisualStyleTypesAndProperties.cs
- UpdateRecord.cs
- serverconfig.cs
- CopyOfAction.cs
- FieldAccessException.cs
- ListViewTableRow.cs
- AmbiguousMatchException.cs
- StorageScalarPropertyMapping.cs
- ColumnClickEvent.cs
- UnitySerializationHolder.cs
- WebPartMinimizeVerb.cs
- XmlDocumentType.cs
- SqlConnectionPoolProviderInfo.cs
- FocusChangedEventArgs.cs
- XmlDeclaration.cs
- ConnectionManagementElement.cs
- IPGlobalProperties.cs
- ToolStripRenderEventArgs.cs
- XmlObjectSerializerReadContextComplexJson.cs
- ComponentResourceManager.cs
- SyndicationFeed.cs
- BaseValidatorDesigner.cs
- DataGridColumn.cs
- DnsPermission.cs
- ProcessManager.cs
- ElapsedEventArgs.cs
- VisualStyleRenderer.cs
- MappedMetaModel.cs
- Pair.cs
- MessageSecurityOverMsmq.cs
- BmpBitmapEncoder.cs
- ScriptBehaviorDescriptor.cs
- Exception.cs
- EntitySqlQueryBuilder.cs
- ScrollViewer.cs
- RoleManagerModule.cs
- DataView.cs
- Mutex.cs
- TextElementEnumerator.cs
- XamlSerializationHelper.cs
- TextServicesContext.cs
- DBCommand.cs
- Attributes.cs
- ResourceAttributes.cs
- WebColorConverter.cs
- LinearGradientBrush.cs
- DrawingCollection.cs
- TriggerAction.cs
- AtomContentProperty.cs
- DecimalAnimationBase.cs
- ScriptComponentDescriptor.cs
- MoveSizeWinEventHandler.cs
- RowSpanVector.cs
- SerializableAttribute.cs
- ObjectKeyFrameCollection.cs