本文整理汇总了C#中InputBuilder类的典型用法代码示例。如果您正苦于以下问题:C# InputBuilder类的具体用法?C# InputBuilder怎么用?C# InputBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputBuilder类属于命名空间,在下文中一共展示了InputBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveMouseToPositionOnVirtualDesktop
public IMouseSimulator MoveMouseToPositionOnVirtualDesktop(double absoluteX, double absoluteY){
Win32Types.INPUT[] inputList =
new InputBuilder().AddAbsoluteMouseMovementOnVirtualDesktop((int) Math.Truncate(absoluteX),
(int) Math.Truncate(absoluteY)).ToArray();
SendSimulatedInput(inputList);
return this;
}
示例2: Should_be_able_to_Generate_the_TextBox_with_the_PlaceHolder
public void Should_be_able_to_Generate_the_TextBox_with_the_PlaceHolder()
{
ITextBoxBuilder textbox = new InputBuilder("Name", HTMLATTRIBUTE.TEXT).WithPlaceholder("SomeText");
string htmlTextBox = textbox.ToString();
var cq = CQ.Create(htmlTextBox);
cq.Attr("name").Should().Be("Name");
cq.Attr("placeholder").Should().Be("SomeText");
}
示例3: Should_be_able_to_Generate_Text_With_the_type_Text_box
public void Should_be_able_to_Generate_Text_With_the_type_Text_box()
{
ITextBoxBuilder textbox = new InputBuilder("Name", HTMLATTRIBUTE.TEXT).Value("Satish");
string htmlTextBox = textbox.ToString();
var cq = CQ.Create(htmlTextBox);
cq.Attr("name").Should().Be("Name");
cq.Val().Should().Be("Satish");
}
示例4: ModifiersUp
private static void ModifiersUp(InputBuilder builder, IEnumerable<VirtualKeyCode> modifierKeyCodes) {
if (modifierKeyCodes == null) return;
var stack = new Stack<VirtualKeyCode>(modifierKeyCodes);
while (stack.Count > 0) {
builder.AddKeyUp(stack.Pop());
}
}
示例5: ModifiersUp
private void ModifiersUp(InputBuilder builder, IEnumerable<VirtualKeyCode> modifierKeyCodes)
{
if (modifierKeyCodes == null) return;
// Key up in reverse (I miss LINQ)
var stack = new Stack<VirtualKeyCode>(modifierKeyCodes);
while (stack.Count > 0) builder.AddKeyUp(stack.Pop());
}
示例6: Should_be_able_to_Generate_the_Password_Box
public void Should_be_able_to_Generate_the_Password_Box()
{
IInputElementBuilder textbox = new InputBuilder("Name", HTMLATTRIBUTE.PASSWORD).Value("Satish");
string htmlTextBox = textbox.ToString();
var cq = CQ.Create(htmlTextBox);
cq.Attr(HTMLATTRIBUTE.TYPE).Should().Be(HTMLATTRIBUTE.PASSWORD);
cq.Val().Should().Be("Satish");
}
示例7: AddKeyDown
public void AddKeyDown()
{
var builder = new InputBuilder();
Assert.IsFalse(builder.ToArray().Any());
builder.AddKeyDown(VirtualKeyCode.VK_A);
Assert.AreEqual(builder.Count(), 1);
Assert.AreEqual(builder[0].Type,(uint)InputType.Keyboard);
Assert.AreEqual(builder[0].Data.Keyboard.KeyCode, (ushort)VirtualKeyCode.VK_A);
}
示例8: Should_be_able_to_add_Id_to_the_property_With_the_Generic_Name
public void Should_be_able_to_add_Id_to_the_property_With_the_Generic_Name()
{
IInputElementBuilder textbox = new InputBuilder("Name", HTMLATTRIBUTE.PASSWORD)
.Class("cssclass");
string htmlTextBox = textbox.ToString();
var cq = CQ.Create(htmlTextBox);
cq.Attr(HTMLATTRIBUTE.TYPE).Should().Be(HTMLATTRIBUTE.PASSWORD);
cq.Attr(HTMLATTRIBUTE.CLASS).Should().Be("cssclass");
}
示例9: AddKeyDown
public void AddKeyDown()
{
var builder = new InputBuilder();
Assert.That(builder.ToArray(), Is.Empty);
builder.AddKeyDown(VirtualKeyCode.VK_A);
Assert.That(builder.Count(), Is.EqualTo(1));
Assert.That(builder[0].Type, Is.EqualTo((uint)InputType.Keyboard));
Assert.That(builder[0].Data.Keyboard.KeyCode, Is.EqualTo((ushort)VirtualKeyCode.VK_A));
}
示例10: KeyPress
/// <summary>
/// Calls the Win32 SendInput method with a KeyDown and KeyUp message in the same input sequence in order to simulate a Key PRESS.
/// </summary>
/// <param name="keyCode">The <see cref="VirtualKeyCode"/> to press</param>
public void KeyPress(VirtualKeyCode keyCode)
{
var inputList =
new InputBuilder()
.AddKeyDown(keyCode)
.AddKeyUp(keyCode)
.ToArray();
SendSimulatedInput(inputList);
}
示例11: Should_be_able_to_Generate_the_Text_With_Disabled_and_ReadOnly_TextBox
public void Should_be_able_to_Generate_the_Text_With_Disabled_and_ReadOnly_TextBox()
{
ITextBoxBuilder textbox = new InputBuilder("Name", HTMLATTRIBUTE.TEXT).Value("Satish").Disabled(true).IsReadOnly(true);
string htmlTextBox = textbox.ToString();
var cq = CQ.Create(htmlTextBox);
cq.Attr("name").Should().Be("Name");
cq.Attr("disabled").Should().Be("disabled");
cq.Attr("readonly").Should().Be("readonly");
cq.Val().Should().Be("Satish");
}
示例12: ModifiedKeyStroke
public IKeyboardSimulator ModifiedKeyStroke(
IEnumerable<Win32Constants.VirtualKeys> modifierKeyCodes, IEnumerable<Win32Constants.VirtualKeys> keyCodes){
var builder = new InputBuilder();
Win32Constants.VirtualKeys[] virtualKeyss = modifierKeyCodes.ToArray();
ModifiersDown(builder, virtualKeyss);
KeysPress(builder, keyCodes);
ModifiersUp(builder, virtualKeyss);
SendSimulatedInput(builder.ToArray());
return this;
}
示例13: Should_be_able_to_Generate_the_Text_With_AutoComplete_and_AutoFoucs_TextBox
public void Should_be_able_to_Generate_the_Text_With_AutoComplete_and_AutoFoucs_TextBox()
{
ITextBoxBuilder textbox = new InputBuilder("Name", HTMLATTRIBUTE.TEXT)
.Value("Satish")
.EnableAutoComplete(true)
.AutoFocus(true);
string htmlTextBox = textbox.ToString();
var cq = CQ.Create(htmlTextBox);
cq.Attr("name").Should().Be("Name");
cq.Attr("AutoFocus").Should().Be("autofocus");
cq.Attr("autocomplete").Should().Be("on");
cq.Val().Should().Be("Satish");
}
示例14: HorizontalScroll
/// <summary>
/// Simulates a mouse horizontal wheel scroll gesture. Supported by Windows Vista and later.
/// </summary>
/// <param name="scrollAmountInClicks">The amount to scroll in clicks. A positive value indicates that the wheel was rotated to the right; a negative value indicates that the wheel was rotated to the left.</param>
public void HorizontalScroll(int scrollAmountInClicks)
{
var inputList = new InputBuilder().AddMouseHorizontalWheelScroll(scrollAmountInClicks * MouseWheelClickSize).ToArray();
SendSimulatedInput(inputList);
}
示例15: LeftButtonUp
/// <summary>
/// Simulates a mouse left button up gesture.
/// </summary>
public void LeftButtonUp()
{
var inputList = new InputBuilder().AddMouseButtonUp(MouseButton.LeftButton).ToArray();
SendSimulatedInput(inputList);
}