AutomationElement.AutomationElementInformation Структура
Определение
public: value class AutomationElement::AutomationElementInformation
public struct AutomationElement.AutomationElementInformation
type AutomationElement.AutomationElementInformation = struct
Public Structure AutomationElement.AutomationElementInformation
- Наследование
Примеры
В следующем примере показано, Name как свойство извлекается из этой структуры.The following example shows how the Name property is retrieved from this structure.
/// <summary>
/// Handles ElementSelected events by showing a message.
/// </summary>
/// <param name="src">Object that raised the event; in this case, a list item.</param>
/// <param name="e">Event arguments.</param>
private void OnSelect(object src, AutomationEventArgs e)
{
// Get the name of the item, which is equivalent to its text.
AutomationElement element = src as AutomationElement;
if (element != null)
{
Console.WriteLine(element.Current.Name + " was selected.");
}
}
''' <summary>
''' Handles ElementSelected events by showing a message.
''' </summary>
''' <param name="src">Object that raised the event; in this case, a list item.</param>
''' <param name="e">Event arguments.</param>
Private Sub OnSelect(ByVal src As Object, ByVal e As AutomationEventArgs)
' Get the name of the item, which is equivalent to its text.
Dim element As AutomationElement = DirectCast(src, AutomationElement)
If (element IsNot Nothing) Then
Console.WriteLine(element.Current.Name + " was selected.")
End If
End Sub
Комментарии
Доступ к свойствам можно получить непосредственно Cached из Currentи; вам AutomationElement.AutomationElementInformation не нужно получать саму структуру.The properties can be accessed directly from Cached and Current; you do not need to retrieve the AutomationElement.AutomationElementInformation structure itself.
Свойства в этой структуре также можно получить с помощью GetCurrentPropertyValue и GetCachedPropertyValue, используя соответствующие идентификаторы из AutomationElement.The properties in this structure can also be retrieved by using GetCurrentPropertyValue and GetCachedPropertyValue, using the corresponding identifiers from AutomationElement. Например, AutomationElement.AutomationElementInformation.AcceleratorKey свойство определяется AutomationElement.AcceleratorKeyProperty полем.For example, The AutomationElement.AutomationElementInformation.AcceleratorKey property is identified by the AutomationElement.AcceleratorKeyProperty field. Дополнительные сведения об отдельных свойствах можно найти на страницах справочника по этим идентификаторам. см. ссылку в разделе "Примечания" каждого раздела справки.More information about the individual properties is available on the reference pages for those identifiers; see the link in the Remarks section of each reference topic.
Свойства
AcceleratorKey |
Возвращает строку, содержащую сочетания клавиш для элемента управления.Gets a string containing the accelerator key combinations for the element. |
AccessKey |
Возвращает строку, содержащую символ клавиши доступа для элемента управления.Gets a string containing the access key character for the element. |
AutomationId |
Получает строку, содержащую Автоматизация пользовательского интерфейсаUI Automationидентификатор (ID)identifier (ID) для элемента.Gets a string containing the Автоматизация пользовательского интерфейсаUI Automation идентификатор (ID)identifier (ID) for the element. |
BoundingRectangle |
Возвращает координаты прямоугольника, который полностью охватывает элемент.Gets the coordinates of the rectangle that completely encloses the element. |
ClassName |
Возвращает строку, содержащую имя класса элемента, назначенное разработчиком элемента управления.Gets a string containing the class name of the element as assigned by the control developer. |
ControlType |
Получает тип ControlType элемента управления.Gets the ControlType of the element. |
FrameworkId |
Возвращает имя базовой архитектуры пользовательского интерфейса.Gets the name of the underlying UI framework. |
HasKeyboardFocus |
Возвращает значение, указывающее, имеет ли элемент фокус ввода.Gets a value that indicates whether the element has keyboard focus. |
HelpText |
Возвращает текст справки, связанный с элементом.Gets the help text associated with the element. |
IsContentElement |
Возвращает значение, которое показывает, является ли элемент элементом содержимого.Gets a value that specifies whether the element is a content element. |
IsControlElement |
Возвращает значение, указывающее, отображается ли элемент как элемент управления.Gets a value that indicates whether the element is viewed as a control. |
IsEnabled |
Возвращает значение, которое показывает, включен ли элемент пользовательский интерфейсuser interface (UI), на который ссылается элемент Автоматизация пользовательского интерфейсаUI Automation.Gets a value that indicates whether the пользовательский интерфейсuser interface (UI) item referenced by the Автоматизация пользовательского интерфейсаUI Automation element is enabled. |
IsKeyboardFocusable |
Возвращает значение, указывающее, может ли элемент Автоматизация пользовательского интерфейсаUI Automation принимать фокус ввода.Gets a value that indicates whether the Автоматизация пользовательского интерфейсаUI Automation element can accept keyboard focus. |
IsOffscreen |
Возвращает значение, которое показывает, отображается ли элемент Автоматизация пользовательского интерфейсаUI Automation на экране.Gets a value that indicates whether the Автоматизация пользовательского интерфейсаUI Automation element is visible on the screen. |
IsPassword |
Возвращает значение, которое показывает, содержит ли элемент Автоматизация пользовательского интерфейсаUI Automation защищенное содержимое.Gets a value that indicates whether the Автоматизация пользовательского интерфейсаUI Automation element contains protected content. |
IsRequiredForForm |
Возвращает значение, которое показывает, должен ли заполняться в форме элемент Автоматизация пользовательского интерфейсаUI Automation.Gets a value that indicates whether the Автоматизация пользовательского интерфейсаUI Automation element is required to be filled out on a form. |
ItemStatus |
Возвращает описание статуса элемента в элементе.Gets a description of the status of an item within an element. |
ItemType |
Возвращает описание типа элемента.Gets a description of the type of an item. |
LabeledBy |
Возвращает элемент, содержащий текстовую метку для данного элемента.Gets the element that contains the text label for this element. |
LocalizedControlType |
Получает описание типа элемента управления.Gets a description of the control type. |
Name |
Возвращает имя элемента.Gets the name of the element. |
NativeWindowHandle |
Возвращает дескриптор окна элемента.Gets the handle of the element's window. |
Orientation |
Возвращает ориентацию элемента управления.Gets the orientation of the control. |
ProcessId |
Возвращает идентификатор (ID)identifier (ID) процесса для данного элемента.Gets the process идентификатор (ID)identifier (ID) of this element. |
Применяется к
Дополнительно
- Общие сведения о свойствах автоматизированного пользовательского интерфейсаUI Automation Properties Overview
- Свойства автоматизации пользовательского интерфейса для клиентовUI Automation Properties for Clients
- Получение свойств элементов управления модели автоматизации пользовательского интерфейсаGet UI Automation Element Properties