/
tsv-dd
/
DocumentFlow
Обзор
Документация
Войти
/
tsv-dd
/
DocumentFlow
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
ksen
DocumentFlow.Controls/DecimalTextBoxAccessibility.cs
68 строк
3 KB
Тепляшин Сергей
Версия 2023.9.22
22 сен 2023, 21:29
22 сен 2023, 21:29
1950681
Код
Авторство
О чём код?
//----------------------------------------------------------------------- // Copyright © 2010-2021 Тепляшин Сергей Васильевич. // Contacts: <sergio.teplyashin@yandex.ru> // License: https://opensource.org/licenses/GPL-3.0 // Date: 22.03.2019 //----------------------------------------------------------------------- namespace DocumentFlow.Controls; public class DecimalTextBoxAccessibility : Control.ControlAccessibleObject { /// <summary> /// DecimalTextBox /// </summary> private readonly DecimalTextBox m_DecimalTextBox; /// <summary> /// Bounds of the Control /// </summary> /// <returns>The accessible object bounds.</returns> public override Rectangle Bounds => m_DecimalTextBox.RectangleToScreen(m_DecimalTextBox.ClientRectangle); /// <summary> /// Gets the role for the RibbonControlAdv. This is used by accessibility programs. /// </summary> public override AccessibleRole Role => AccessibleRole.Text; /// <summary> /// Gets or sets the accessible object name /// </summary> /// <returns>The accessible object name.</returns> public override string Name => m_DecimalTextBox.Name; /// <summary> /// Gets the description of the RibbonControlAdvAccessibility /// </summary> /// <returns> A string describing the RibbonControlAdvAccessibility.</returns> public override string Description => $"DecimalTextBox,{m_DecimalTextBox.Style},{m_DecimalTextBox.Text},{m_DecimalTextBox.Bounds.X},{m_DecimalTextBox.Bounds.Y},{m_DecimalTextBox.Bounds.Width},{m_DecimalTextBox.Bounds.Height},{m_DecimalTextBox.Name},{m_DecimalTextBox.ContainsFocus},{m_DecimalTextBox.Enabled}"; /// <summary> /// Constructor /// </summary> /// <param name="DecimalTextBox">The RibbonControlAdv instance.</param> public DecimalTextBoxAccessibility(DecimalTextBox DecimalTextBox) : base(DecimalTextBox) { m_DecimalTextBox = DecimalTextBox; } /// <summary> /// Retrieves the child object at the specified screen coordinates. /// </summary> /// <param name="x">The horizontal screen coordinate.</param> /// <param name="y">The vertical screen coordinate.</param> /// <returns>An RibbonControlAdvAccessibility that represents the child object at the given screen coordinates. /// This method returns the calling object if the object itself is at the location specified. /// Returns null if no object is at the tested location.</returns> public override AccessibleObject? HitTest(int x, int y) { var childAtPoint = m_DecimalTextBox.GetChildAtPoint(m_DecimalTextBox.PointToClient(new Point(x, y))); if (childAtPoint != null) { return childAtPoint.AccessibilityObject; } return base.HitTest(x, y); } }