-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathDisplayConfigInfoBuilder.cs
More file actions
64 lines (56 loc) · 1.78 KB
/
Copy pathDisplayConfigInfoBuilder.cs
File metadata and controls
64 lines (56 loc) · 1.78 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
using DisplayProfileManager.Helpers;
namespace DisplayProfileManager.Tests.Helpers
{
/// <summary>
/// Fluent builder para <see cref="DisplayConfigHelper.DisplayConfigInfo"/> em contextos de teste.
/// </summary>
internal sealed class DisplayConfigInfoBuilder
{
private readonly DisplayConfigHelper.DisplayConfigInfo _info = new DisplayConfigHelper.DisplayConfigInfo
{
TargetId = 0,
SourceId = 0,
IsEnabled = true,
Width = 1920,
Height = 1080,
RefreshRate = 60,
DisplayPositionX = 0,
DisplayPositionY = 0,
DeviceName = "\\\\.\\DISPLAY1",
FriendlyName = "Test Monitor"
};
public DisplayConfigInfoBuilder WithTargetId(uint id)
{
_info.TargetId = id;
return this;
}
public DisplayConfigInfoBuilder WithSourceId(uint id)
{
_info.SourceId = id;
return this;
}
public DisplayConfigInfoBuilder WithResolution(int width, int height)
{
_info.Width = width;
_info.Height = height;
return this;
}
public DisplayConfigInfoBuilder WithRefreshRate(double hz)
{
_info.RefreshRate = hz;
return this;
}
public DisplayConfigInfoBuilder WithPosition(int x, int y)
{
_info.DisplayPositionX = x;
_info.DisplayPositionY = y;
return this;
}
public DisplayConfigInfoBuilder Disabled()
{
_info.IsEnabled = false;
return this;
}
public DisplayConfigHelper.DisplayConfigInfo Build() => _info;
}
}