-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebUIClassAdditions.cs
41 lines (26 loc) · 999 Bytes
/
WebUIClassAdditions.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
using System;
using System.Collections.Concurrent;
using __IntPtr = global::System.IntPtr;
namespace WebUILib {
public partial class Window {
public Window() {
__Instance = new __IntPtr(__Internal.WebuiNewWindow());
__RecordNativeToManagedMapping(__Instance, this);
}
partial void DisposePartial(bool disposing) {
Destroy();
}
public ulong Bind(string element, WrappedWebEventHandler func) { //could switch to a compiled expression rather
WebEventHandler customDel = (__IntPtr evt) => func(WebUIEvent.__GetOrCreateInstance(evt));
knownDels[element] = customDel;
return Bind(element, customDel);
}
private ConcurrentDictionary<string, WebEventHandler> knownDels = new();
public delegate void WrappedWebEventHandler(WebUIEvent evt);
public class WindowConfig {
public int ScriptEvaulationMaxReturnSize = 1024 * 1024 * 8;
public TimeSpan ScriptEvaluationDefaultTimeout = TimeSpan.FromSeconds(15);
}
public WindowConfig config = new();
}
}