Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- WebPartMenu.cs
- MimeMultiPart.cs
- _DigestClient.cs
- DiscoveryServerProtocol.cs
- ContentType.cs
- MachineKey.cs
- ImageListUtils.cs
- Point3DValueSerializer.cs
- AnchoredBlock.cs
- DataObjectCopyingEventArgs.cs
- InvalidDataException.cs
- SystemUdpStatistics.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ClockGroup.cs
- LinqDataSourceContextEventArgs.cs
- DataGridPageChangedEventArgs.cs
- Evidence.cs
- DataGridCommandEventArgs.cs
- TextEmbeddedObject.cs
- EmptyEnumerable.cs
- Grid.cs
- AssemblyInfo.cs
- StateInitializationDesigner.cs
- ForAllOperator.cs
- HitTestParameters.cs
- WebPartDisplayModeCollection.cs
- TraceListeners.cs
- QuaternionRotation3D.cs
- ResourceCategoryAttribute.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- HybridCollection.cs
- TransformGroup.cs
- ThemeDictionaryExtension.cs
- TraceEventCache.cs
- ImportDesigner.xaml.cs
- EditorZone.cs
- ScriptDescriptor.cs
- ApplicationManager.cs
- QilNode.cs
- Object.cs
- SearchExpression.cs
- EntityClientCacheEntry.cs
- XmlReflectionImporter.cs
- Memoizer.cs
- LockCookie.cs
- FixedSOMImage.cs
- SmiEventSink_DeferedProcessing.cs
- ClonableStack.cs
- ConfigurationSection.cs
- CodeLabeledStatement.cs
- EncoderBestFitFallback.cs
- Listbox.cs
- ExpressionLexer.cs
- PartialCachingControl.cs
- EditorPartCollection.cs
- QualifierSet.cs
- EncryptedPackageFilter.cs
- CompilationAssemblyInstallComponent.cs
- IdentityNotMappedException.cs
- KeyInstance.cs
- BaseConfigurationRecord.cs
- StringArrayConverter.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- PersonalizationProvider.cs
- EventProviderTraceListener.cs
- HttpWebRequest.cs
- AutomationEvent.cs
- DataColumn.cs
- ColumnCollection.cs
- ExplicitDiscriminatorMap.cs
- XmlSchemaRedefine.cs
- HeaderCollection.cs
- EpmContentDeSerializer.cs
- ToolStripActionList.cs
- ipaddressinformationcollection.cs
- SqlProviderServices.cs
- XhtmlBasicSelectionListAdapter.cs
- DataTableClearEvent.cs
- CacheOutputQuery.cs
- NullRuntimeConfig.cs
- CompModHelpers.cs
- StrokeCollection.cs
- xmlsaver.cs
- XmlNodeReader.cs
- ComboBoxRenderer.cs
- ReadOnlyDataSource.cs
- LocalizableAttribute.cs
- RootAction.cs
- HttpCapabilitiesSectionHandler.cs
- NativeWindow.cs
- VariableReference.cs
- GacUtil.cs
- ByteBufferPool.cs
- SerTrace.cs
- QilPatternFactory.cs
- AttributeCollection.cs
- CapabilitiesAssignment.cs
- TransactionManagerProxy.cs
- AppDomainProtocolHandler.cs
- TableLayoutCellPaintEventArgs.cs