本文整理汇总了C#中InputBuilder类的典型用法代码示例。如果您正苦于以下问题:C# InputBuilder类的具体用法?C# InputBuilder怎么用?C# InputBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputBuilder类属于命名空间,在下文中一共展示了InputBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:derjabkin,项目名称:eXpand,代码行数:7,代码来源:MouseSimulator.cs
示例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");
}
开发者ID:satish860,项目名称:FluentHTML,代码行数:8,代码来源:FluentTextBoxTest.cs
示例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");
}
开发者ID:satish860,项目名称:FluentHTML,代码行数:8,代码来源:FluentTextBoxTest.cs
示例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());
}
}
开发者ID:gro-ove,项目名称:actools,代码行数:8,代码来源:KeyboardSimulator.cs
示例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());
}
开发者ID:HouSong,项目名称:inputsimulator,代码行数:8,代码来源:KeyboardSimulator.cs
示例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");
}
开发者ID:satish860,项目名称:FluentHTML,代码行数:8,代码来源:FluentPasswordBoxTest.cs
示例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);
}
开发者ID:HaKDMoDz,项目名称:InputSimulator,代码行数:9,代码来源:InputBuilderTests.cs
示例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");
}
开发者ID:satish860,项目名称:FluentHTML,代码行数:9,代码来源:FluentPasswordBoxTest.cs
示例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));
}
开发者ID:HouSong,项目名称:inputsimulator,代码行数:9,代码来源:InputBuilderTests.cs
示例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);
}
开发者ID:HaKDMoDz,项目名称:baro-corelibrary,代码行数:14,代码来源:KeyboardSimulator.cs
示例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");
}
开发者ID:satish860,项目名称:FluentHTML,代码行数:10,代码来源:FluentTextBoxTest.cs
示例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;
}
开发者ID:derjabkin,项目名称:eXpand,代码行数:11,代码来源:KeyboardSimulator.cs
示例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");
}
开发者ID:satish860,项目名称:FluentHTML,代码行数:13,代码来源:FluentTextBoxTest.cs
示例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);
}
开发者ID:Hebo,项目名称:LeagueMaster,代码行数:9,代码来源:MouseSimulator.cs
示例15: LeftButtonUp
/// <summary>
/// Simulates a mouse left button up gesture.
/// </summary>
public void LeftButtonUp()
{
var inputList = new InputBuilder().AddMouseButtonUp(MouseButton.LeftButton).ToArray();
SendSimulatedInput(inputList);
}
开发者ID:Hebo,项目名称:LeagueMaster,代码行数:8,代码来源:MouseSimulator.cs
示例16: RightButtonDown
/// <summary>
/// Simulates a mouse right button down gesture.
/// </summary>
public void RightButtonDown()
{
var inputList = new InputBuilder().AddMouseButtonDown(MouseButton.RightButton).ToArray();
SendSimulatedInput(inputList);
}
开发者ID:Hebo,项目名称:LeagueMaster,代码行数:8,代码来源:MouseSimulator.cs
示例17: XButtonUp
/// <summary>
/// Simulates a mouse X button up gesture.
/// </summary>
/// <param name="buttonId">The button id.</param>
public void XButtonUp(int buttonId)
{
var inputList = new InputBuilder().AddMouseXButtonUp(buttonId).ToArray();
SendSimulatedInput(inputList);
}
开发者ID:Hebo,项目名称:LeagueMaster,代码行数:9,代码来源:MouseSimulator.cs
示例18: XButtonState
/// <summary>
/// X button state
/// </summary>
/// <param name="btn">id</param>
/// <param name="isDown">down or up</param>
public IMouseSimulator XButtonState(MouseButton btn, bool isDown)
{
INPUT[] inputList = null;
if (isDown)
{
inputList = new InputBuilder().AddMouseButtonDown(btn).ToArray();
}
else
{
inputList = new InputBuilder().AddMouseButtonUp(btn).ToArray();
}
SendSimulatedInput(inputList);
return this;
}
开发者ID:mind0n,项目名称:hive,代码行数:19,代码来源:MouseSimulator.cs
示例19: MoveMouseToPositionOnVirtualDesktop
/// <summary>
/// Simulates mouse movement to the specified location on the Virtual Desktop which includes all active displays.
/// </summary>
/// <param name="absoluteX">The destination's absolute X-coordinate on the virtual desktop where 0 is the left hand side of the virtual desktop and 65535 is the extreme right hand side of the virtual desktop.</param>
/// <param name="absoluteY">The destination's absolute Y-coordinate on the virtual desktop where 0 is the top of the virtual desktop and 65535 is the bottom of the virtual desktop.</param>
public void MoveMouseToPositionOnVirtualDesktop(double absoluteX, double absoluteY)
{
var inputList = new InputBuilder().AddAbsoluteMouseMovementOnVirtualDesktop((int)Math.Truncate(absoluteX), (int)Math.Truncate(absoluteY)).ToArray();
SendSimulatedInput(inputList);
}
开发者ID:Hebo,项目名称:LeagueMaster,代码行数:10,代码来源:MouseSimulator.cs
示例20: ModifiedKeyStroke
/// <summary>
/// Simulates a modified keystroke where there are multiple modifiers and one key like CTRL-ALT-C where CTRL and ALT are the modifierKeys and C is the key.
/// The flow is Modifiers KeyDown in order, Key Press, Modifiers KeyUp in reverse order.
/// </summary>
/// <param name="modifierKeyCodes">The list of modifier keys</param>
/// <param name="keyCode">The key to simulate</param>
public void ModifiedKeyStroke(IEnumerable<VirtualKeyCode> modifierKeyCodes, VirtualKeyCode keyCode)
{
var builder = new InputBuilder();
var modifierKeyCodesList = modifierKeyCodes.ToList();
if (modifierKeyCodes != null) modifierKeyCodesList.ForEach(x => builder.AddKeyDown(x));
builder.AddKeyPress(keyCode);
if (modifierKeyCodes != null)
{
modifierKeyCodesList.Reverse();
modifierKeyCodesList.ForEach(x => builder.AddKeyUp(x));
}
SendSimulatedInput(builder.ToArray());
}
开发者ID:HaKDMoDz,项目名称:InputSimulator,代码行数:20,代码来源:KeyboardSimulator.cs
注:本文中的InputBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论