-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
WebAppManagerOptions.cs
73 lines (62 loc) · 2.22 KB
/
WebAppManagerOptions.cs
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
namespace Legerity.Web;
using System.Collections.Generic;
using System.Drawing;
/// <summary>
/// Defines a specific <see cref="AppManagerOptions"/> for a Web application.
/// </summary>
public class WebAppManagerOptions : AppManagerOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="WebAppManagerOptions"/> class.
/// </summary>
public WebAppManagerOptions()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="WebAppManagerOptions"/> class.
/// </summary>
/// <param name="driverType">The type of web application driver to start.</param>
/// <param name="driverDirectoryPath">The path to the web application driver directory.</param>
public WebAppManagerOptions(WebAppDriverType driverType, string driverDirectoryPath)
{
this.DriverType = driverType;
this.DriverUri = driverDirectoryPath;
}
/// <summary>
/// Gets or sets the type of web application driver to start.
/// </summary>
public WebAppDriverType DriverType { get; set; }
/// <summary>
/// Gets or sets the URL of the web application to load.
/// </summary>
public string Url { get; set; }
/// <summary>
/// Gets or sets the desired size of the window for the web application.
/// <para>
/// The default value is 1280x800.
/// </para>
/// <para>
/// If <see cref="Maximize"/> is set to true, this value is ignored.
/// </para>
/// </summary>
public Size DesiredSize { get; set; } = new Size(1280, 800);
/// <summary>
/// Gets or sets a value indicating whether to maximize the window for the web application.
/// </summary>
public bool Maximize { get; set; }
/// <summary>Returns a string that represents the current object.</summary>
/// <returns>A string that represents the current object.</returns>
public override string ToString()
{
return $"Platform [{this.DriverType}], {base.ToString()}, {this.GetOptionDetails()}";
}
private string GetOptionDetails()
{
var options = new List<string>();
if (!string.IsNullOrWhiteSpace(this.Url))
{
options.Add($"URL [{this.Url}]");
}
return string.Join(", ", options);
}
}