mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-20 13:23:13 -07:00
Hello GitHub
This commit is contained in:
parent
456fe5e355
commit
c13b8a099e
822 changed files with 276650 additions and 75 deletions
|
@ -0,0 +1,56 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using MS.Internal.Mita.Foundation;
|
||||
using MS.Internal.Mita.Foundation.Controls;
|
||||
using MS.Internal.Mita.Foundation.Waiters;
|
||||
|
||||
namespace Calculator.UIAutomationLibrary.Components
|
||||
{
|
||||
public class ProgrammerCalculatorPom : UIObject
|
||||
{
|
||||
private const string FullKeypadButtonId = "fullKeypad";
|
||||
private const string BitFlipKeypadButtonId = "bitFlip";
|
||||
private const string CalculatorResultsId = "CalculatorResults";
|
||||
private const string NumberPadId = "NumberPad";
|
||||
|
||||
private readonly string[] BitLengthButtonIds =
|
||||
{
|
||||
"qwordButton",
|
||||
"dwordButton",
|
||||
"wordButton",
|
||||
"byteButton"
|
||||
};
|
||||
|
||||
public ProgrammerCalculatorPom(UIObject uiObject) : base(uiObject)
|
||||
{
|
||||
}
|
||||
|
||||
public NumberPadPom NumberPad => new NumberPadPom(this.Descendants.Find(NumberPadId));
|
||||
|
||||
public MemoryPom MemoryControls => new MemoryPom(this);
|
||||
|
||||
public RadioButton FullKeypadButton => new RadioButton(this.Descendants.Find(FullKeypadButtonId));
|
||||
|
||||
public RadioButton BitFlipKeypadButton => new RadioButton(this.Descendants.Find(BitFlipKeypadButtonId));
|
||||
|
||||
public TextBlock Display => new TextBlock(this.Descendants.Find(CalculatorResultsId));
|
||||
|
||||
public UIEventWaiter GetDisplayChangedWaiter() => this.Display.GetNameChangedWaiter();
|
||||
|
||||
public Button GetCurrentBitLengthButton()
|
||||
{
|
||||
// There are four bit length buttons, with only one visible at a time.
|
||||
UIObject button = null;
|
||||
foreach (var buttonId in this.BitLengthButtonIds)
|
||||
{
|
||||
if (this.Descendants.TryFind(buttonId, out button))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new Button(button);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue