-
Notifications
You must be signed in to change notification settings - Fork 476
Expand file tree
/
Copy pathTableVerticalScrollBar.cs
More file actions
75 lines (62 loc) · 1.74 KB
/
TableVerticalScrollBar.cs
File metadata and controls
75 lines (62 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System.Windows.Automation;
using TestStack.White.UIA;
using TestStack.White.UIItems.Actions;
using TestStack.White.UIItems.Scrolling;
namespace TestStack.White.UIItems.TableItems
{
//TODO Table in scrolled position is not supported
public class TableVerticalScrollBar : UIItem, IVScrollBar
{
private readonly TableVerticalScrollOffset offset;
protected TableVerticalScrollBar() {}
public TableVerticalScrollBar(AutomationElement automationElement, ActionListener actionListener, TableVerticalScrollOffset offset)
: base(automationElement, actionListener)
{
this.offset = offset;
}
public virtual void ScrollUp()
{
mouse.Wheel(Bounds.Center(), 1, actionListener);
}
public virtual void ScrollDown()
{
mouse.Wheel(Bounds.Center(), -1, actionListener);
}
public virtual void ScrollUpLarge()
{
ScrollUp();
}
public virtual void ScrollDownLarge()
{
ScrollDown();
}
public virtual bool IsScrollable
{
get { return true; }
}
public virtual bool IsNotMinimum
{
get { return !offset.IsOnTop; }
}
public virtual double Value
{
get { return 0; }
}
public virtual double MinimumValue
{
get { return 0; }
}
public virtual double MaximumValue
{
get { return 100; }
}
public virtual void SetToMinimum()
{
while (IsNotMinimum)
{
ScrollUpLarge();
}
}
public virtual void SetToMaximum() {}
}
}