-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathWebDriverFactoryOptions.cs
55 lines (39 loc) · 1.64 KB
/
WebDriverFactoryOptions.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
using Gsemac.Net.WebBrowsers;
using System;
namespace Gsemac.Net.WebDrivers {
public class WebDriverFactoryOptions :
IWebDriverFactoryOptions {
// Public members
public bool AutoUpdateEnabled { get; set; } = true;
public bool IgnoreUpdateErrors { get; set; } = true;
public WebBrowserId WebBrowserId {
get => webBrowserId;
set => webBrowserId = value;
}
public IWebBrowserInfo WebBrowser {
get => webBrowserInfo;
set {
webBrowserInfo = value;
if (webBrowserInfo is object)
WebBrowserId = webBrowserInfo.Id;
}
}
public bool KillWebDriverProcessesOnDispose { get; set; } = false;
public string WebDriverDirectoryPath { get; set; }
public static WebDriverFactoryOptions Default => new WebDriverFactoryOptions();
public WebDriverFactoryOptions() { }
public WebDriverFactoryOptions(IWebDriverFactoryOptions options) {
if (options is null)
throw new ArgumentNullException(nameof(options));
AutoUpdateEnabled = options.AutoUpdateEnabled;
IgnoreUpdateErrors = options.IgnoreUpdateErrors;
WebBrowserId = options.WebBrowserId;
WebBrowser = options.WebBrowser;
KillWebDriverProcessesOnDispose = options.KillWebDriverProcessesOnDispose;
WebDriverDirectoryPath = options.WebDriverDirectoryPath;
}
// Private members
private WebBrowserId webBrowserId = WebBrowserId.Unknown;
private IWebBrowserInfo webBrowserInfo;
}
}