Skip to content

Commit 412f628

Browse files
implement Session-API, fix code selection problem for the Demo Web-App.
1 parent 3cb9216 commit 412f628

File tree

15 files changed

+889
-15
lines changed

15 files changed

+889
-15
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace ElectronNET.API.Entities
2+
{
3+
/// <summary>
4+
///
5+
/// </summary>
6+
public class ClearStorageDataOptions
7+
{
8+
/// <summary>
9+
/// Should follow window.location.origin’s representation scheme://host:port.
10+
/// </summary>
11+
public string Origin { get; set; }
12+
13+
/// <summary>
14+
/// The types of storages to clear, can contain: appcache, cookies, filesystem,
15+
/// indexdb, localstorage, shadercache, websql, serviceworkers, cachestorage.
16+
/// </summary>
17+
public string[] Storages { get; set; }
18+
19+
/// <summary>
20+
/// The types of quotas to clear, can contain: temporary, persistent, syncable.
21+
/// </summary>
22+
public string[] Quotas { get; set; }
23+
}
24+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
namespace ElectronNET.API.Entities
2+
{
3+
/// <summary>
4+
///
5+
/// </summary>
6+
public class CreateInterruptedDownloadOptions
7+
{
8+
/// <summary>
9+
/// Absolute path of the download.
10+
/// </summary>
11+
public string Path { get; set; }
12+
13+
/// <summary>
14+
/// Complete URL chain for the download.
15+
/// </summary>
16+
public string[] UrlChain { get; set; }
17+
18+
/// <summary>
19+
///
20+
/// </summary>
21+
public string MimeType { get; set; }
22+
23+
/// <summary>
24+
/// Start range for the download.
25+
/// </summary>
26+
public int Offset { get; set; }
27+
28+
/// <summary>
29+
/// Total length of the download.
30+
/// </summary>
31+
public int Length { get; set; }
32+
33+
/// <summary>
34+
/// Last-Modified header value.
35+
/// </summary>
36+
public string LastModified { get; set; }
37+
38+
/// <summary>
39+
/// ETag header value.
40+
/// </summary>
41+
public string ETag { get; set; }
42+
43+
/// <summary>
44+
/// Time when download was started in number of seconds since UNIX epoch.
45+
/// </summary>
46+
public int StartTime { get; set; }
47+
48+
/// <summary>
49+
///
50+
/// </summary>
51+
/// <param name="path">Absolute path of the download.</param>
52+
/// <param name="urlChain">Complete URL chain for the download.</param>
53+
/// <param name="offset">Start range for the download.</param>
54+
/// <param name="length">Total length of the download.</param>
55+
/// <param name="lastModified">Last-Modified header value.</param>
56+
/// <param name="eTag">ETag header value.</param>
57+
public CreateInterruptedDownloadOptions(string path, string[] urlChain, int offset, int length, string lastModified, string eTag)
58+
{
59+
Path = path;
60+
UrlChain = urlChain;
61+
Offset = offset;
62+
Length = length;
63+
LastModified = lastModified;
64+
ETag = eTag;
65+
}
66+
}
67+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace ElectronNET.API.Entities
6+
{
7+
/// <summary>
8+
///
9+
/// </summary>
10+
public class EnableNetworkEmulationOptions
11+
{
12+
/// <summary>
13+
/// Whether to emulate network outage. Defaults to false.
14+
/// </summary>
15+
public bool Offline { get; set; } = false;
16+
17+
/// <summary>
18+
/// RTT in ms. Defaults to 0 which will disable latency throttling.
19+
/// </summary>
20+
public int Latency { get; set; }
21+
22+
/// <summary>
23+
/// Download rate in Bps. Defaults to 0 which will disable download throttling.
24+
/// </summary>
25+
public int DownloadThroughput { get; set; }
26+
27+
/// <summary>
28+
/// Upload rate in Bps. Defaults to 0 which will disable upload throttling.
29+
/// </summary>
30+
public int UploadThroughput { get; set; }
31+
}
32+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace ElectronNET.API.Entities
6+
{
7+
/// <summary>
8+
///
9+
/// </summary>
10+
public class ProxyConfig
11+
{
12+
/// <summary>
13+
/// The URL associated with the PAC file.
14+
/// </summary>
15+
public string PacScript { get; set; }
16+
17+
/// <summary>
18+
/// Rules indicating which proxies to use.
19+
/// </summary>
20+
public string ProxyRules { get; set; }
21+
22+
/// <summary>
23+
/// Rules indicating which URLs should bypass the proxy settings.
24+
/// </summary>
25+
public string ProxyBypassRules { get; set; }
26+
27+
/// <summary>
28+
///
29+
/// </summary>
30+
/// <param name="pacScript">The URL associated with the PAC file.</param>
31+
/// <param name="proxyRules">Rules indicating which proxies to use.</param>
32+
/// <param name="proxyBypassRules">Rules indicating which URLs should bypass the proxy settings.</param>
33+
public ProxyConfig(string pacScript, string proxyRules, string proxyBypassRules)
34+
{
35+
PacScript = pacScript;
36+
ProxyRules = proxyRules;
37+
ProxyBypassRules = proxyBypassRules;
38+
}
39+
}
40+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
namespace ElectronNET.API.Entities
2+
{
3+
/// <summary>
4+
///
5+
/// </summary>
6+
public class RemoveClientCertificate
7+
{
8+
/// <summary>
9+
/// Origin of the server whose associated client certificate must be removed from
10+
/// the cache.
11+
/// </summary>
12+
public string Origin { get; set; }
13+
14+
/// <summary>
15+
/// clientCertificate.
16+
/// </summary>
17+
public string Type { get; set; }
18+
19+
/// <summary>
20+
///
21+
/// </summary>
22+
/// <param name="origin">Origin of the server whose associated client certificate
23+
/// must be removed from the cache.</param>
24+
/// <param name="type">clientCertificate.</param>
25+
public RemoveClientCertificate(string origin, string type)
26+
{
27+
Origin = origin;
28+
Type = type;
29+
}
30+
}
31+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using Newtonsoft.Json;
2+
using Newtonsoft.Json.Converters;
3+
4+
namespace ElectronNET.API.Entities
5+
{
6+
/// <summary>
7+
///
8+
/// </summary>
9+
public class RemovePassword
10+
{
11+
/// <summary>
12+
/// When provided, the authentication info related to the origin will only be
13+
/// removed otherwise the entire cache will be cleared.
14+
/// </summary>
15+
public string Origin { get; set; }
16+
17+
/// <summary>
18+
/// Credentials of the authentication. Must be provided if removing by origin.
19+
/// </summary>
20+
public string Password { get; set; }
21+
22+
/// <summary>
23+
/// Realm of the authentication. Must be provided if removing by origin.
24+
/// </summary>
25+
public string Realm { get; set; }
26+
27+
/// <summary>
28+
/// Scheme of the authentication. Can be basic, digest, ntlm, negotiate.
29+
/// Must be provided if removing by origin.
30+
/// </summary>
31+
[JsonConverter(typeof(StringEnumConverter))]
32+
public Scheme Scheme { get; set; }
33+
34+
/// <summary>
35+
/// password.
36+
/// </summary>
37+
public string Type { get; set; }
38+
39+
/// <summary>
40+
/// Credentials of the authentication. Must be provided if removing by origin.
41+
/// </summary>
42+
public string Username { get; set; }
43+
44+
/// <summary>
45+
///
46+
/// </summary>
47+
/// <param name="type">password.</param>
48+
public RemovePassword(string type)
49+
{
50+
Type = type;
51+
}
52+
}
53+
}

ElectronNET.API/Entities/Scheme.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace ElectronNET.API.Entities
2+
{
3+
/// <summary>
4+
///
5+
/// </summary>
6+
public enum Scheme
7+
{
8+
/// <summary>
9+
///
10+
/// </summary>
11+
basic,
12+
13+
/// <summary>
14+
///
15+
/// </summary>
16+
digest,
17+
18+
/// <summary>
19+
///
20+
/// </summary>
21+
ntlm,
22+
23+
/// <summary>
24+
///
25+
/// </summary>
26+
negotiate
27+
}
28+
}

0 commit comments

Comments
 (0)