mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Compare commits
647 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b0ab76d38 | ||
|
|
349762bd5e | ||
|
|
0b49467186 | ||
|
|
6fa65aa149 | ||
|
|
816e9c0fe9 | ||
|
|
c81b0e537f | ||
|
|
b89e3caa17 | ||
|
|
e8c5de63c9 | ||
|
|
d7b9174853 | ||
|
|
5ba4ab24d5 | ||
|
|
c6ff957d9a | ||
|
|
c37f98dcd6 | ||
|
|
0188051d6c | ||
|
|
3eb8507985 | ||
|
|
546668a2c0 | ||
|
|
68feffba02 | ||
|
|
12d2fcb484 | ||
|
|
979cf72d4c | ||
|
|
14bf7fdcd8 | ||
|
|
f89f2e7591 | ||
|
|
9a0a494bc5 | ||
|
|
41a2b075c9 | ||
|
|
adc1e81743 | ||
|
|
d8062aae00 | ||
|
|
0522bc425b | ||
|
|
168eceac8c | ||
|
|
4736bc640c | ||
|
|
18b1317fc5 | ||
|
|
dfe04f14d0 | ||
|
|
9d6861ffcd | ||
|
|
d8b0d0443d | ||
|
|
71ced8db56 | ||
|
|
fc69598b09 | ||
|
|
60a278c41f | ||
|
|
9d25795b7a | ||
|
|
5b597cc12c | ||
|
|
707c0f5a7b | ||
|
|
bb59bc8365 | ||
|
|
423ea57af7 | ||
|
|
8dcc3721eb | ||
|
|
dc27511aa5 | ||
|
|
dd465baebf | ||
|
|
04210955a3 | ||
|
|
4129cc17a6 | ||
|
|
bc0f601dd8 | ||
|
|
95fd7aa665 | ||
|
|
402147b8ef | ||
|
|
ed7cc434ea | ||
|
|
c5fb5f62d9 | ||
|
|
84989cda25 | ||
|
|
84b3c59353 | ||
|
|
c1e7b84ec6 | ||
|
|
9bb7dcfa62 | ||
|
|
c0e711940d | ||
|
|
d03458094b | ||
|
|
14962e1983 | ||
|
|
d79b73e960 | ||
|
|
21ae89bc70 | ||
|
|
7927a95cb8 | ||
|
|
758e6a41e3 | ||
|
|
61421ddd66 | ||
|
|
98d085f112 | ||
|
|
cf0b12ed0a | ||
|
|
4c3065c64b | ||
|
|
2a6d2117e9 | ||
|
|
93f457dd0f | ||
|
|
6001a3c481 | ||
|
|
4671b9b32a | ||
|
|
de7f98136e | ||
|
|
87668f5606 | ||
|
|
ea688026d0 | ||
|
|
b6b9292478 | ||
|
|
408f83e401 | ||
|
|
689a002dc2 | ||
|
|
f919289628 | ||
|
|
2c544a83e9 | ||
|
|
2b393079ae | ||
|
|
79d3d3f0b1 | ||
|
|
688d6d83cc | ||
|
|
7bcc5c9878 | ||
|
|
0cfadb36f5 | ||
|
|
568c785412 | ||
|
|
2944e69b21 | ||
|
|
8df9eff3bc | ||
|
|
14f43f4574 | ||
|
|
d96eebd5ee | ||
|
|
23fac3263f | ||
|
|
935de8a1a5 | ||
|
|
c2ba55e333 | ||
|
|
be1887c930 | ||
|
|
1852802667 | ||
|
|
5bdabd94ba | ||
|
|
2bc2b4bb70 | ||
|
|
771b1109f7 | ||
|
|
56258d1be8 | ||
|
|
88766adaf6 | ||
|
|
341ebe2bb1 | ||
|
|
0c5cc3ba9d | ||
|
|
bb5779a941 | ||
|
|
0dd263e2b8 | ||
|
|
0a0e26a9dd | ||
|
|
7b812bfae7 | ||
|
|
82814d91d9 | ||
|
|
fcb589d58e | ||
|
|
c914bb8f14 | ||
|
|
bf3e149d43 | ||
|
|
6060e355bd | ||
|
|
868451408c | ||
|
|
bef7a42fbb | ||
|
|
50b49068d8 | ||
|
|
cf87904210 | ||
|
|
0b05b2f5a4 | ||
|
|
1ea4c1343d | ||
|
|
5d5e0b848c | ||
|
|
2d626ab319 | ||
|
|
2e051762dd | ||
|
|
96063bbe7d | ||
|
|
471289813a | ||
|
|
d0d214cd24 | ||
|
|
43ce20d60f | ||
|
|
40d6558613 | ||
|
|
ae12eb49ee | ||
|
|
2a26b46f91 | ||
|
|
78b59f62c9 | ||
|
|
667a1b290e | ||
|
|
c5d9ba0e43 | ||
|
|
f81424978e | ||
|
|
7fcb2f05bd | ||
|
|
69129a6f02 | ||
|
|
bcde1032af | ||
|
|
3a42c479dd | ||
|
|
c6c73a7c8a | ||
|
|
d1db928222 | ||
|
|
b06d20450b | ||
|
|
3811b7ea20 | ||
|
|
9275f2a765 | ||
|
|
feddf5f8f4 | ||
|
|
e4ce61c965 | ||
|
|
1e93d91e66 | ||
|
|
77efea50ed | ||
|
|
5ea368bb16 | ||
|
|
0dca0e90f9 | ||
|
|
c0c3aaebdc | ||
|
|
14722e1f63 | ||
|
|
d6e39fef24 | ||
|
|
74b80b3177 | ||
|
|
0f3f29eae3 | ||
|
|
f634dc45ed | ||
|
|
c6b9de2afa | ||
|
|
9a615ca7e0 | ||
|
|
f9601a6e3e | ||
|
|
8daf4d1498 | ||
|
|
c01ef407af | ||
|
|
dc019adb10 | ||
|
|
f7de17f1ee | ||
|
|
ca748384cf | ||
|
|
4c880cb627 | ||
|
|
e46ba98c8d | ||
|
|
4b9fe4656e | ||
|
|
fdb8be46b7 | ||
|
|
e361367a95 | ||
|
|
7ca40bcaec | ||
|
|
1864c21c10 | ||
|
|
0775b91dd4 | ||
|
|
f55dbc14c0 | ||
|
|
6472f34a75 | ||
|
|
91714f5807 | ||
|
|
6182320003 | ||
|
|
5125ee0109 | ||
|
|
21c17dc82b | ||
|
|
dbcd4ac940 | ||
|
|
286978c523 | ||
|
|
96ae77ceb4 | ||
|
|
a893ccd646 | ||
|
|
2edad2d329 | ||
|
|
7be796f77b | ||
|
|
19da7f47b1 | ||
|
|
d22532488e | ||
|
|
30558dea5f | ||
|
|
464eaca593 | ||
|
|
df3bd122df | ||
|
|
eabcc3a6b6 | ||
|
|
2b5435381f | ||
|
|
0d63383899 | ||
|
|
f31fe19652 | ||
|
|
0a80367e3e | ||
|
|
34761456ad | ||
|
|
e4e96bbcc4 | ||
|
|
1253df3d9a | ||
|
|
b8b634beb3 | ||
|
|
94dc82ec62 | ||
|
|
53ccf4d302 | ||
|
|
bf0bdc8386 | ||
|
|
73a3e331dc | ||
|
|
a15db713ad | ||
|
|
4be5cef3ef | ||
|
|
e2d03d6818 | ||
|
|
0dc8369fb3 | ||
|
|
77b7141513 | ||
|
|
dbf85c6f14 | ||
|
|
c67f117bc7 | ||
|
|
9746edb936 | ||
|
|
23f4d39a30 | ||
|
|
05ac4a1886 | ||
|
|
33ac4edbe3 | ||
|
|
e5f9bae64f | ||
|
|
437404d6cc | ||
|
|
1ae2f1de93 | ||
|
|
6bfd0c33af | ||
|
|
6311d55a75 | ||
|
|
7b522c1779 | ||
|
|
b1c08f5865 | ||
|
|
a3f19055b9 | ||
|
|
ef9a95d9e9 | ||
|
|
2367035acd | ||
|
|
3470a70572 | ||
|
|
1365918efd | ||
|
|
e909de54af | ||
|
|
a2514ed5bc | ||
|
|
b453278803 | ||
|
|
a244382383 | ||
|
|
a82e714ef8 | ||
|
|
b339485fdc | ||
|
|
551635867d | ||
|
|
941b8cf5c2 | ||
|
|
06b01f75da | ||
|
|
e4b1f6586e | ||
|
|
0657a274d4 | ||
|
|
e3acc79c4f | ||
|
|
73c1d1cd46 | ||
|
|
c2a8c627b9 | ||
|
|
1862094861 | ||
|
|
0ad89c7d22 | ||
|
|
0af664b8a6 | ||
|
|
afcd113675 | ||
|
|
0e22ee3fd3 | ||
|
|
ce0cdf39c6 | ||
|
|
305544ab42 | ||
|
|
78d9d601b1 | ||
|
|
fdd643ba48 | ||
|
|
29a257251f | ||
|
|
3676db89d3 | ||
|
|
29011189f8 | ||
|
|
9d7d859764 | ||
|
|
5cdda5595a | ||
|
|
62fe944ae3 | ||
|
|
617eb15df8 | ||
|
|
bff71dc86a | ||
|
|
f0280f420a | ||
|
|
9f7809810f | ||
|
|
e610c96550 | ||
|
|
f3bd3d07d5 | ||
|
|
0e8cfec689 | ||
|
|
c1b3d422d5 | ||
|
|
fc12363e11 | ||
|
|
02f2fd770c | ||
|
|
5ee1918bb4 | ||
|
|
2213c61746 | ||
|
|
3cdff747fe | ||
|
|
476cc9e505 | ||
|
|
fb8ca94e8e | ||
|
|
c94702fc60 | ||
|
|
cd9e06d5db | ||
|
|
613f0a05b3 | ||
|
|
de2ce85a5c | ||
|
|
e5d47e077b | ||
|
|
ac77ccce9f | ||
|
|
504cc59760 | ||
|
|
0ee7097f31 | ||
|
|
2d93d959f7 | ||
|
|
a4d261a4e7 | ||
|
|
3838fe8971 | ||
|
|
b5e69f5dda | ||
|
|
55a3f10d37 | ||
|
|
7e494518f3 | ||
|
|
4596492cd9 | ||
|
|
dd5bfd3961 | ||
|
|
5d907864d8 | ||
|
|
30941df39c | ||
|
|
3588a8696d | ||
|
|
876bb98d92 | ||
|
|
427b57a002 | ||
|
|
cc0b15c61e | ||
|
|
8a0276daf9 | ||
|
|
e94196504e | ||
|
|
6076c727d1 | ||
|
|
300dc49dde | ||
|
|
ce0f3fd61e | ||
|
|
12f5eae65c | ||
|
|
3ef44cf878 | ||
|
|
41fa8e9e74 | ||
|
|
49e21de465 | ||
|
|
d2f6308dd2 | ||
|
|
f06b95803f | ||
|
|
b9feff3436 | ||
|
|
335489d2d9 | ||
|
|
6fe0c6f085 | ||
|
|
f82d185865 | ||
|
|
550e2c2625 | ||
|
|
61f54ebd55 | ||
|
|
c8c818a77a | ||
|
|
fc590f55d8 | ||
|
|
5fbe01df30 | ||
|
|
dbf4d0f720 | ||
|
|
f996b3023e | ||
|
|
7f62e7299b | ||
|
|
b803e42a73 | ||
|
|
da1838db60 | ||
|
|
8af1f50b88 | ||
|
|
c4f2188c62 | ||
|
|
e73655bd68 | ||
|
|
758424d3ce | ||
|
|
7518acb3c2 | ||
|
|
5522addc0b | ||
|
|
7f204c2a42 | ||
|
|
de13f49bb6 | ||
|
|
bca37228d9 | ||
|
|
e17a36f7cb | ||
|
|
deccebb582 | ||
|
|
776ccc21e8 | ||
|
|
d0c92cac85 | ||
|
|
b525bf1a9a | ||
|
|
6337cac588 | ||
|
|
5d4509babe | ||
|
|
3eef85cddf | ||
|
|
3f582d6c4e | ||
|
|
18c5a65d6d | ||
|
|
f8bbb138d8 | ||
|
|
7880d56e4c | ||
|
|
c16a888699 | ||
|
|
814e046d5c | ||
|
|
d2457203bc | ||
|
|
a70304948a | ||
|
|
a49b2ce278 | ||
|
|
1577146187 | ||
|
|
d61f20dd67 | ||
|
|
f7217b417f | ||
|
|
e136ed4127 | ||
|
|
7489543c75 | ||
|
|
cbf3032617 | ||
|
|
68c54b9917 | ||
|
|
26d10fca38 | ||
|
|
bd15587079 | ||
|
|
42613f5b56 | ||
|
|
62117df108 | ||
|
|
f68ea25cba | ||
|
|
4e9de2abfa | ||
|
|
a08d274dc1 | ||
|
|
3dea16798b | ||
|
|
bf8c7c8fa1 | ||
|
|
06724f6eae | ||
|
|
83e579d44b | ||
|
|
ed67aa8072 | ||
|
|
f1ceaa208e | ||
|
|
5e005499ef | ||
|
|
975e4020dc | ||
|
|
15ce35a7d9 | ||
|
|
de1637672a | ||
|
|
6b75f63135 | ||
|
|
8f92d3986f | ||
|
|
ca7414b8e6 | ||
|
|
37ae869dcb | ||
|
|
3420ee2de4 | ||
|
|
0a76e951eb | ||
|
|
4db316eb15 | ||
|
|
a867f23220 | ||
|
|
490440c23a | ||
|
|
519fb53c00 | ||
|
|
12388541ab | ||
|
|
8c8115f3bd | ||
|
|
4286bc4f45 | ||
|
|
886f839482 | ||
|
|
96abbd161c | ||
|
|
9baf1528ac | ||
|
|
380441c2c8 | ||
|
|
a66375e37c | ||
|
|
606d00de5a | ||
|
|
b3266cd93f | ||
|
|
cb36e34dc3 | ||
|
|
db7a5ff868 | ||
|
|
a030e3cbe7 | ||
|
|
b98c570b9d | ||
|
|
d106c6b193 | ||
|
|
c95bbe7ab2 | ||
|
|
258710bc52 | ||
|
|
9ddb1b195e | ||
|
|
eee84d214e | ||
|
|
1ab48350e1 | ||
|
|
874bc8eb94 | ||
|
|
7aa2268a81 | ||
|
|
b08222bddc | ||
|
|
c5c822a028 | ||
|
|
ce4ef03636 | ||
|
|
641864b946 | ||
|
|
c6d67a9145 | ||
|
|
fabd25a89e | ||
|
|
029b077602 | ||
|
|
0329530815 | ||
|
|
58ab180c94 | ||
|
|
a03dc1d195 | ||
|
|
76dcdc4137 | ||
|
|
2b415e5b59 | ||
|
|
94055b985f | ||
|
|
596aa68c70 | ||
|
|
485bce08d7 | ||
|
|
2ba49dbd6a | ||
|
|
39c3e92128 | ||
|
|
c552a04347 | ||
|
|
1541553ed1 | ||
|
|
52b850092c | ||
|
|
cac9cfcec8 | ||
|
|
4ad39ba4c1 | ||
|
|
95acbd5dea | ||
|
|
95f9a59431 | ||
|
|
d409c3a0f9 | ||
|
|
6d0fbde5ad | ||
|
|
b113532a86 | ||
|
|
b043688f7f | ||
|
|
3b3e38f1bf | ||
|
|
9502eb787a | ||
|
|
4a9b6fa9c1 | ||
|
|
fb308ed1c6 | ||
|
|
d51a481e50 | ||
|
|
bb3d073fae | ||
|
|
8c250ae83e | ||
|
|
a5543bfe60 | ||
|
|
c40affb32e | ||
|
|
e9331728b4 | ||
|
|
92b0388300 | ||
|
|
f4ea6df204 | ||
|
|
b027ca7c66 | ||
|
|
0573e92ed5 | ||
|
|
672e3b86fd | ||
|
|
b7960eb772 | ||
|
|
bbab114c54 | ||
|
|
e77f48b2c5 | ||
|
|
8fe60bfcda | ||
|
|
09fa662ed1 | ||
|
|
7f2269c4bd | ||
|
|
05de4071d1 | ||
|
|
169abc2376 | ||
|
|
12a3f2689e | ||
|
|
14587463e7 | ||
|
|
6690b4a76e | ||
|
|
c8e51ef21b | ||
|
|
96a5189f14 | ||
|
|
13fcedc3a0 | ||
|
|
c12c26b491 | ||
|
|
6ddce85bdd | ||
|
|
68ee626d07 | ||
|
|
fd5801ffdc | ||
|
|
df02855471 | ||
|
|
b6417d0718 | ||
|
|
6f1f7cbc5e | ||
|
|
aec0da6075 | ||
|
|
c9f0c43bc9 | ||
|
|
b87d7f9899 | ||
|
|
fa51cdd72c | ||
|
|
9b270755d0 | ||
|
|
c5db735773 | ||
|
|
88f5995f40 | ||
|
|
042cd7e6cb | ||
|
|
cb096212f9 | ||
|
|
0363dc8924 | ||
|
|
8cf5053512 | ||
|
|
32046adfb5 | ||
|
|
003a9d0d35 | ||
|
|
db6bed43dc | ||
|
|
80d160a71c | ||
|
|
01d938fb1a | ||
|
|
00eb9869dc | ||
|
|
2987e3143d | ||
|
|
20ca72b794 | ||
|
|
a0e0cc3bbc | ||
|
|
e295558258 | ||
|
|
e67f6c500b | ||
|
|
23015a9f3d | ||
|
|
7daac2d04e | ||
|
|
71955b9181 | ||
|
|
a619b6e5c9 | ||
|
|
3ba3fa6414 | ||
|
|
11fbd6b259 | ||
|
|
073eb0e00d | ||
|
|
c0bf257b55 | ||
|
|
62b37d059f | ||
|
|
ca8f4c454c | ||
|
|
d660dff871 | ||
|
|
c17720a4d7 | ||
|
|
274552f52b | ||
|
|
1e3fe6183c | ||
|
|
88b04377a7 | ||
|
|
92356d3587 | ||
|
|
a3c452eea5 | ||
|
|
68288d9d73 | ||
|
|
022221307c | ||
|
|
ffc6353bf2 | ||
|
|
f4d8144a8b | ||
|
|
30d49ff6e8 | ||
|
|
db9d3b1484 | ||
|
|
a788d71530 | ||
|
|
f5e2abfdb4 | ||
|
|
42f09de7b5 | ||
|
|
72d1f4b2b9 | ||
|
|
d2b3c28f91 | ||
|
|
94c4cd82b0 | ||
|
|
600bc1a41b | ||
|
|
4e8e771293 | ||
|
|
4014ef7a4d | ||
|
|
364db7dc25 | ||
|
|
3dda18ac9a | ||
|
|
7f92ffa20e | ||
|
|
b69d4d23bf | ||
|
|
eb4144053d | ||
|
|
239d914747 | ||
|
|
5af8e489b9 | ||
|
|
b6fb1cb0bf | ||
|
|
aa98b85f18 | ||
|
|
af74d24f50 | ||
|
|
2240ffca82 | ||
|
|
f64b780a27 | ||
|
|
fbc5b93513 | ||
|
|
14d02706c0 | ||
|
|
2c14693430 | ||
|
|
54ff11acf5 | ||
|
|
b7e7ace6f3 | ||
|
|
1f7908a0f1 | ||
|
|
cafffde339 | ||
|
|
6fbba52edd | ||
|
|
8dd5d1561a | ||
|
|
25f35e34fe | ||
|
|
f1eaffb203 | ||
|
|
69ca5d6f9e | ||
|
|
5cd11a8110 | ||
|
|
c343b19a60 | ||
|
|
b3bb3ceb97 | ||
|
|
e25b89ff6a | ||
|
|
28be0dd209 | ||
|
|
8bf10c370c | ||
|
|
a32b50f86f | ||
|
|
a781234d05 | ||
|
|
8b66bdd7cb | ||
|
|
ba64639c1d | ||
|
|
5157561dc6 | ||
|
|
bbecd86cce | ||
|
|
bd99da560b | ||
|
|
9278402d65 | ||
|
|
9bc1b46810 | ||
|
|
d2956e6f2f | ||
|
|
da4e930478 | ||
|
|
8e9f7b016a | ||
|
|
10e95afa5c | ||
|
|
68505f8feb | ||
|
|
c91884a520 | ||
|
|
ccf0a4c73b | ||
|
|
660663d9c1 | ||
|
|
36ee9c4dd7 | ||
|
|
9f7c99db53 | ||
|
|
b9ba162a88 | ||
|
|
ad399f50ee | ||
|
|
428e53e265 | ||
|
|
0a02b7140b | ||
|
|
f6ea0dd8dc | ||
|
|
dc8987de5a | ||
|
|
dc73be0c81 | ||
|
|
4dc8f189f9 | ||
|
|
5ec179af5d | ||
|
|
802b1acf68 | ||
|
|
07a0bc9c7d | ||
|
|
43028afc02 | ||
|
|
d3d73611b7 | ||
|
|
6d31c41479 | ||
|
|
98a549560f | ||
|
|
8a3b9951fa | ||
|
|
552b4331b2 | ||
|
|
38785f9b18 | ||
|
|
886b4b81a5 | ||
|
|
e6b6f990d7 | ||
|
|
a2ada57292 | ||
|
|
0cede6131e | ||
|
|
ce52988aac | ||
|
|
3a52680a54 | ||
|
|
6d28e57f04 | ||
|
|
a2cdabf8cb | ||
|
|
25ab81ca8f | ||
|
|
5ba54ab40b | ||
|
|
cca8110c38 | ||
|
|
06f43032b4 | ||
|
|
0709d61120 | ||
|
|
aa09af8ad6 | ||
|
|
e90ef9e48d | ||
|
|
6d076fb99a | ||
|
|
131d1d9dd1 | ||
|
|
e5132e8198 | ||
|
|
6a7c60fdb5 | ||
|
|
8605fab9a7 | ||
|
|
c03d6e8976 | ||
|
|
5e0ef7edb5 | ||
|
|
5300609360 | ||
|
|
ed6ebe90b1 | ||
|
|
4e95322468 | ||
|
|
412f628422 | ||
|
|
3cb92169dd | ||
|
|
aea2c7aff5 | ||
|
|
ba16c4e032 | ||
|
|
8b5bb636f3 | ||
|
|
0fac6ae1cd | ||
|
|
24d1f6f844 | ||
|
|
73f7e5a7b2 | ||
|
|
01d1397a60 | ||
|
|
77e7280b1f | ||
|
|
8d6a5a757e | ||
|
|
f2e0808ede | ||
|
|
aa7efbad4b | ||
|
|
d0c52a1364 | ||
|
|
4235aa4677 | ||
|
|
8a3c86abc0 | ||
|
|
eda9b08cac | ||
|
|
a5cee6e6d5 | ||
|
|
4db0ac0ebb | ||
|
|
2a9c0e1d60 | ||
|
|
7dc3072b5f | ||
|
|
6642f9d505 | ||
|
|
078ac99098 | ||
|
|
f7cc2a995f | ||
|
|
c0ee3b8859 | ||
|
|
597df77508 | ||
|
|
f709f65f9e | ||
|
|
71d2b88b02 | ||
|
|
f4631c99f7 | ||
|
|
04968d088b | ||
|
|
5d446b23fa | ||
|
|
2b3eabf75a | ||
|
|
27a5057bb0 | ||
|
|
28f0ffaf62 | ||
|
|
0f085fdb1d | ||
|
|
7d8301af54 | ||
|
|
132b20b4ae | ||
|
|
cca5f7f40d | ||
|
|
63c2bcdf7c | ||
|
|
cad371c221 | ||
|
|
f4efad299a | ||
|
|
17e4646d11 | ||
|
|
977f389e2f | ||
|
|
b6ec73cb84 | ||
|
|
15499e38bf | ||
|
|
538bc02b54 | ||
|
|
2fb3062d4b |
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [GregorBiswanger, FlorianRappl]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: https://donorbox.org/electron-net
|
||||
27
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Please search existing issues to avoid creating duplicates. -->
|
||||
|
||||
<!-- Which version of Electron.NET CLI and API are you using? -->
|
||||
<!-- Please always try to use latest version before report. -->
|
||||
* **Version**:
|
||||
|
||||
<!-- Which version of .NET Core and Node.js are you using (if applicable)? -->
|
||||
|
||||
<!-- What target are you building for? -->
|
||||
* **Target**:
|
||||
|
||||
<!-- Enter your issue details below this comment. -->
|
||||
<!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) -->
|
||||
|
||||
Steps to Reproduce:
|
||||
|
||||
1.
|
||||
2.
|
||||
13
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: Feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Please search existing feature request to avoid creating duplicates. -->
|
||||
|
||||
<!-- If you want, you can donate to increase feature request priority (https://donorbox.org/electron-net) -->
|
||||
<!-- Describe the feature you'd like. -->
|
||||
13
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
name: Question
|
||||
about: The issue tracker is not for questions. Please ask questions on https://stackoverflow.com/questions/tagged/electron.net
|
||||
or via chat in https://gitter.im/ElectronNET/community.
|
||||
title: ''
|
||||
labels: question
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
🚨 The issue tracker is not for questions 🚨
|
||||
|
||||
The issue tracker is not for questions. Please ask questions on https://stackoverflow.com/questions/tagged/electron.net or via chat in https://gitter.im/ElectronNET/community.
|
||||
BIN
.github/WikiLinks.exe
vendored
Normal file
BIN
.github/WikiLinks.exe
vendored
Normal file
Binary file not shown.
51
.github/workflows/ci.yml
vendored
Normal file
51
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
|
||||
|
||||
jobs:
|
||||
# linux:
|
||||
# runs-on: ubuntu-latest
|
||||
# timeout-minutes: 10
|
||||
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
|
||||
# - name: Setup dotnet
|
||||
# uses: actions/setup-dotnet@v4
|
||||
# with:
|
||||
# dotnet-version: |
|
||||
# 6.0.x
|
||||
# 8.0.x
|
||||
# 10.0.x
|
||||
|
||||
# - name: Build
|
||||
# run: ./build.sh
|
||||
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: |
|
||||
6.0.x
|
||||
8.0.x
|
||||
10.0.x
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
if ($env:GITHUB_REF -eq "refs/heads/main") {
|
||||
.\build.ps1 -Target Publish
|
||||
} elseif ($env:GITHUB_REF -eq "refs/heads/develop") {
|
||||
.\build.ps1 -Target PrePublish
|
||||
} else {
|
||||
.\build.ps1
|
||||
}
|
||||
59
.github/workflows/publish-wiki.yml
vendored
Normal file
59
.github/workflows/publish-wiki.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Publish wiki
|
||||
on:
|
||||
push:
|
||||
branches: [electronnet_core, main]
|
||||
workflow_dispatch:
|
||||
concurrency:
|
||||
group: publish-wiki
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
publish-wiki:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Remove level 1 headings from Markdown files
|
||||
shell: bash
|
||||
run: |
|
||||
find docs/ -name '*.md' -exec sed -i '1d' {} \;
|
||||
- name: Move all files to root folder
|
||||
shell: bash
|
||||
run: |
|
||||
mv docs/*/* docs/
|
||||
- name: Delete unwanted files
|
||||
shell: bash
|
||||
run: |
|
||||
# rm docs/*.xlsm
|
||||
# rm docs/*.pptx
|
||||
rm docs/*.shproj
|
||||
- name: Stripping file extensions....
|
||||
uses: softworkz/strip-markdown-extensions-from-links-action@main
|
||||
with:
|
||||
path: ./docs/
|
||||
- name: Copy Changelog
|
||||
shell: bash
|
||||
run: |
|
||||
cp Changelog.md docs/RelInfo/ 2>/dev/null || true
|
||||
- name: Copy images to wiki/wiki folder
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir docs/wiki
|
||||
cp docs/*.svg docs/wiki/ 2>/dev/null || true
|
||||
cp docs/*.png docs/wiki/ 2>/dev/null || true
|
||||
cp docs/*.jpg docs/wiki/ 2>/dev/null || true
|
||||
cp docs/*.gif docs/wiki/ 2>/dev/null || true
|
||||
cp docs/*.mp4 docs/wiki/ 2>/dev/null || true
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git config --global user.name "GitHub Action"
|
||||
git config --global user.email "action@github.com"
|
||||
git add -A
|
||||
git commit -m "Automatically update Markdown files" || echo "No changes to commit"
|
||||
- uses: Andrew-Chen-Wang/github-wiki-action@v4.4.0
|
||||
with:
|
||||
path: docs/
|
||||
ignore: |
|
||||
'**/*.xlsm'
|
||||
'**/*.pptx'
|
||||
'**/*.shproj'
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -44,7 +44,7 @@ dlldata.c
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
!/artifacts/readme.md
|
||||
!/artifacts/.gitkeep
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
@@ -260,3 +260,10 @@ paket-files/
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Mac Only settings file
|
||||
.DS_Store
|
||||
|
||||
# Nuke build tool
|
||||
.nuke/temp
|
||||
/publish.cmd
|
||||
|
||||
137
.nuke/build.schema.json
Normal file
137
.nuke/build.schema.json
Normal file
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"definitions": {
|
||||
"Host": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"AppVeyor",
|
||||
"AzurePipelines",
|
||||
"Bamboo",
|
||||
"Bitbucket",
|
||||
"Bitrise",
|
||||
"GitHubActions",
|
||||
"GitLab",
|
||||
"Jenkins",
|
||||
"Rider",
|
||||
"SpaceAutomation",
|
||||
"TeamCity",
|
||||
"Terminal",
|
||||
"TravisCI",
|
||||
"VisualStudio",
|
||||
"VSCode"
|
||||
]
|
||||
},
|
||||
"ExecutableTarget": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Clean",
|
||||
"Compile",
|
||||
"Default",
|
||||
"Package",
|
||||
"PrePublish",
|
||||
"Publish",
|
||||
"PublishPackages",
|
||||
"PublishPreRelease",
|
||||
"PublishRelease",
|
||||
"Restore",
|
||||
"RunUnitTests"
|
||||
]
|
||||
},
|
||||
"Verbosity": {
|
||||
"type": "string",
|
||||
"description": "",
|
||||
"enum": [
|
||||
"Verbose",
|
||||
"Normal",
|
||||
"Minimal",
|
||||
"Quiet"
|
||||
]
|
||||
},
|
||||
"NukeBuild": {
|
||||
"properties": {
|
||||
"Continue": {
|
||||
"type": "boolean",
|
||||
"description": "Indicates to continue a previously failed build attempt"
|
||||
},
|
||||
"Help": {
|
||||
"type": "boolean",
|
||||
"description": "Shows the help text for this build assembly"
|
||||
},
|
||||
"Host": {
|
||||
"description": "Host for execution. Default is 'automatic'",
|
||||
"$ref": "#/definitions/Host"
|
||||
},
|
||||
"NoLogo": {
|
||||
"type": "boolean",
|
||||
"description": "Disables displaying the NUKE logo"
|
||||
},
|
||||
"Partition": {
|
||||
"type": "string",
|
||||
"description": "Partition to use on CI"
|
||||
},
|
||||
"Plan": {
|
||||
"type": "boolean",
|
||||
"description": "Shows the execution plan (HTML)"
|
||||
},
|
||||
"Profile": {
|
||||
"type": "array",
|
||||
"description": "Defines the profiles to load",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"Root": {
|
||||
"type": "string",
|
||||
"description": "Root directory during build execution"
|
||||
},
|
||||
"Skip": {
|
||||
"type": "array",
|
||||
"description": "List of targets to be skipped. Empty list skips all dependencies",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ExecutableTarget"
|
||||
}
|
||||
},
|
||||
"Target": {
|
||||
"type": "array",
|
||||
"description": "List of targets to be invoked. Default is '{default_target}'",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ExecutableTarget"
|
||||
}
|
||||
},
|
||||
"Verbosity": {
|
||||
"description": "Logging verbosity during build execution. Default is 'Normal'",
|
||||
"$ref": "#/definitions/Verbosity"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"CommonPropsFilePath": {
|
||||
"type": "string",
|
||||
"description": "common.props file path - to determine the configured version"
|
||||
},
|
||||
"Configuration": {
|
||||
"type": "string",
|
||||
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
|
||||
"enum": [
|
||||
"Debug",
|
||||
"Release"
|
||||
]
|
||||
},
|
||||
"ReleaseNotesFilePath": {
|
||||
"type": "string",
|
||||
"description": "ReleaseNotesFilePath - To determine the lates changelog version"
|
||||
},
|
||||
"Solution": {
|
||||
"type": "string",
|
||||
"description": "Path to a solution file that is automatically loaded"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/NukeBuild"
|
||||
}
|
||||
]
|
||||
}
|
||||
4
.nuke/parameters.json
Normal file
4
.nuke/parameters.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "./build.schema.json",
|
||||
"Solution": "src/ElectronNET.Lean.sln"
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
language: csharp
|
||||
mono: none
|
||||
dotnet: 2.1.300
|
||||
before_script:
|
||||
- export PATH="$PATH:/home/travis/.dotnet/tools"
|
||||
- npm install electron-packager --global
|
||||
script:
|
||||
- ./buildAll.sh
|
||||
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@@ -10,9 +10,9 @@
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceRoot}/ElectronNET.CLI/bin/Debug/netcoreapp2.0/dotnet-electronize.dll",
|
||||
"program": "${workspaceRoot}/src/ElectronNET.CLI/bin/Debug/net8.0/dotnet-electronize.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceRoot}/ElectronNET.CLI",
|
||||
"cwd": "${workspaceRoot}/src/ElectronNET.CLI",
|
||||
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
|
||||
"console": "internalConsole",
|
||||
"stopAtEntry": false,
|
||||
|
||||
32
.vscode/tasks.json
vendored
32
.vscode/tasks.json
vendored
@@ -1,16 +1,18 @@
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"command": "dotnet",
|
||||
"isShellCommand": true,
|
||||
"args": [],
|
||||
"tasks": [
|
||||
{
|
||||
"taskName": "build",
|
||||
"args": [
|
||||
"${workspaceRoot}/ElectronNET.CLI/ElectronNET.CLI.csproj"
|
||||
],
|
||||
"isBuildCommand": true,
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
||||
"version": "2.0.0",
|
||||
"command": "dotnet",
|
||||
"args": [],
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": ["build", "${workspaceRoot}/src/ElectronNET.CLI/ElectronNET.CLI.csproj"],
|
||||
"problemMatcher": "$msCompile",
|
||||
"group": {
|
||||
"_id": "build",
|
||||
"isDefault": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
157
Changelog.md
157
Changelog.md
@@ -1,110 +1,85 @@
|
||||
# not release
|
||||
# 0.1.0
|
||||
|
||||
## ElectronNET.Core
|
||||
|
||||
# 0.0.11
|
||||
- Updated `PrintToPDFOptions` to also allow specifying the `PageSize` with an object (#769)
|
||||
- Updated splashscreen image to have 0 margin (#622)
|
||||
- Updated the IPC API w.r.t. naming and consistency (#905) @agracio
|
||||
- Updated the IPC bridge w.r.t. synchronization and thread-safety (#918) @agracio
|
||||
- Updated serialization to use `System.Text.Json` replacing `Newtonsoft.Json` (#917) @Denny09310
|
||||
- Fixed parameter handling for the `sendToIpcRenderer` function (#922) @softworkz
|
||||
- Fixed synchronization on removing event handlers (#921) @softworkz
|
||||
- Fixed creation of windows with `contextIsolation` enabled (#906) @NimbusFox
|
||||
- Fixed single instance behavior using the `ElectronSingleInstance` property (#901)
|
||||
- Fixed potential race conditions (#908) @softworkz
|
||||
- Added option to use `ElectronSplashScreen` with an HTML file (#799)
|
||||
- Added option to provide floating point value as aspect ratios with `SetAspectRatio` (#793)
|
||||
- Added option to provide `TitleBarOverlay` as an object (#911) @Denny09310
|
||||
- Added `TitleBarOverlay` property to `BrowserWindowOptions` (#909)
|
||||
- Added `RoundedCorners` property to `BrowserWindowOptions`
|
||||
- Added integration tests and robustness checks (#913) @softworkz
|
||||
- Added .NET 10 as an explicit target
|
||||
|
||||
ElectronNET.CLI:
|
||||
# 0.0.18
|
||||
|
||||
* Invoke 'npm install' without --prod flag to install needed devDependencies as well.
|
||||
* Enable SourceLink
|
||||
* NuGet Package License Information updated (deprecation of licenseUrl)
|
||||
## ElectronNET.Core
|
||||
|
||||
ElectronNET.API:
|
||||
### Highlights
|
||||
|
||||
* Documentation added for WebContents.GetUrl()
|
||||
* Enable SourceLink
|
||||
* NuGet Package License Information updated (deprecation of licenseUrl)
|
||||
- **Complete MSBuild Integration**: Eliminated CLI tool dependency, moved all build processes to MSBuild with deep Visual Studio integration
|
||||
- **Modernized Architecture**: Restructured process lifecycle with .NET launching first and running Electron as child process for better control and reliability
|
||||
- **Cross-Platform Development**: Build and debug Linux applications directly from Windows Visual Studio via WSL integration
|
||||
- **Flexible Electron Versioning**: Removed version lock-in, users can now select any Electron version with build-time validation
|
||||
- **Enhanced Debugging Experience**: ASP.NET-first debugging with Hot Reload support and improved process termination handling
|
||||
- **Console App Support**: No longer requires ASP.NET - now works with simple console applications for file system or remote server HTML/JS
|
||||
|
||||
# 0.0.10
|
||||
### Build System & Project Structure
|
||||
|
||||
ElectronNET.API:
|
||||
- Eliminated electron.manifest.json configuration file, replaced with MSBuild project properties
|
||||
- Introduced new package structure: ElectronNET.Core (main package), ElectronNET.Core.Api (API definitions), ElectronNET.Core.AspNet (ASP.NET integration)
|
||||
- Added Runtime Identifier (RID) selection as part of project configuration
|
||||
- Restructured build folder layout to use standard .NET format (bin\net8.0\win-x64) instead of bin\Desktop
|
||||
- Implemented incremental build support for Electron assets to improve build performance
|
||||
- Added custom MSBuild tasks for Electron-specific build operations
|
||||
|
||||
* manifestJsonFilePath fixed (thanks @smack0007)
|
||||
* Use Electron release 3.0.0 and updated packages (thanks @deinok)
|
||||
* fixes for Socket interaction (thanks @mojinxun)
|
||||
* Fixing SingleInstances (thanks @yaofeng)
|
||||
* Enhance WebContent.GetUrl (thanks @ru-sh)
|
||||
### Development Experience
|
||||
|
||||
ElectronNET.CLI:
|
||||
- Implemented unpackaged run-mode for development using regular .NET builds with unpackaged Electron configuration
|
||||
- Added support for building Linux packages on Windows via WSL integration
|
||||
- Enabled running and debugging Linux application outputs on Windows through WSL
|
||||
- Integrated TypeScript compilation with ASP.NET tooling for consistent builds
|
||||
- Added process orchestration supporting 8 different launch scenarios (packaged/unpackaged × console/ASP.NET × dotnet-first/electron-first)
|
||||
|
||||
* Show Resultcode for better debugging when using Build/Start Command
|
||||
* ElectronNET.CLI is now a global dotnet tool
|
||||
### Debugging & Runtime
|
||||
|
||||
# 0.0.9
|
||||
- Dramatically improved debugging experience with ASP.NET-first launch mode
|
||||
- Added Hot Reload support for ASP.NET code during development
|
||||
- Implemented proper process termination handling for all exit scenarios
|
||||
- Minimized startup times through optimized build and launch procedures
|
||||
|
||||
ElectronNET.API:
|
||||
### Technical Improvements
|
||||
|
||||
* Better Async handling - thanks @danielmarbach
|
||||
- Enhanced splash screen handling with automatic path resolution
|
||||
- Improved ElectronHostHook integration as proper npm package dependency
|
||||
- Updated to latest TypeScript version with ESLint configuration
|
||||
- Added support for custom main.js files in projects
|
||||
- Implemented version management through common.props file
|
||||
- Added build-time Electron version compatibility validation
|
||||
|
||||
ElectronNET.CLI:
|
||||
### Package & Distribution
|
||||
|
||||
* More options on the 'build' command, e.g. for a 32bit debug build with electron prune: build /target custom win7-x86;win32 /dotnet-configuration Debug /electron-arch ia32 /electron-params "--prune=true "
|
||||
* .NET Core project is now build with Release configuration, but can be adjusted with the new params.
|
||||
* Be aware: "Breaking" (but because of the alpha status of this project, we won't use SemVer)
|
||||
- Integrated MSBuild publishing mechanisms for creating Electron packages
|
||||
- Added folder publishing support with improved parameter handling
|
||||
- Implemented automated package.json generation from MSBuild properties
|
||||
- Added GitHub release automation with proper versioning
|
||||
- Reduced package sizes by eliminating unnecessary TypeScript dependencies
|
||||
|
||||
# 0.0.8
|
||||
### Migration & Compatibility
|
||||
|
||||
This version was skipped because we unfortunatly released a pre version of this on NuGet.
|
||||
- Maintained backward compatibility for existing ElectronHostHook implementations
|
||||
- Removed ASP.NET requirement: Now works with simple console applications for file system or remote server HTML/JS scenarios
|
||||
- Added support for both console and ASP.NET Core application types
|
||||
- Preserved all existing Electron API functionality while modernizing architecture
|
||||
- Added migration path for existing projects through updated package structure
|
||||
|
||||
# 0.0.7
|
||||
|
||||
ElectronNET.CLI:
|
||||
|
||||
* Fixed electronize start for macos/linux - thanks @yamachu
|
||||
* Skip NPM install on start when node_modules directory already exists
|
||||
|
||||
# 0.0.6
|
||||
|
||||
ElectronNET.CLI:
|
||||
|
||||
* nuget packages are now release bits and have the correct assembly verion
|
||||
* Version command
|
||||
* better devCleanup.cmd
|
||||
* Better Platform Support Issue - thanks to @Petermarcu
|
||||
* Start Command should now work on OSX/Linux - thanks to @r105m
|
||||
|
||||
ElectronNET.API:
|
||||
|
||||
* Thread-Safe methods - thanks to @yeskunall
|
||||
|
||||
# 0.0.5
|
||||
|
||||
ElectronNET.API:
|
||||
|
||||
* The last nuget package didn't contain the actual webpreferences settings with defaults - hopefully now.
|
||||
|
||||
# 0.0.4
|
||||
|
||||
ElectronNET.CLI:
|
||||
|
||||
* dotnet electronize start fixed
|
||||
|
||||
ElectronNET.API:
|
||||
|
||||
* WebPreferences settings with default values
|
||||
|
||||
# 0.0.3
|
||||
|
||||
ElectronNET.CLI:
|
||||
* Init with Debug profile
|
||||
* Build for all platforms (well... for newest OSX/Linux/Windows)
|
||||
|
||||
ElectronNET.API:
|
||||
* Moar XML documentation
|
||||
* Hybrid support (e.g. running as normal website and electron app)
|
||||
* Event bugfixing
|
||||
|
||||
# 0.0.2
|
||||
|
||||
ElectronNET.CLI:
|
||||
* Added Init to Help page
|
||||
* Added XML documentation to NuGet output
|
||||
* Maybe fixed for https://github.com/GregorBiswanger/Electron.NET/issues/2
|
||||
|
||||
ElectronNET.API:
|
||||
* Add XML documentation to NuGet output
|
||||
* Implemented Notification-, Dialog- & Tray-API
|
||||
|
||||
# 0.0.1
|
||||
|
||||
* init everything and basic functionality
|
||||
This represents a comprehensive modernization of Electron.NET, addressing the major pain points around debugging, build complexity, and platform limitations while maintaining full API compatibility.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
||||
using Quobject.SocketIoClientDotNet.Client;
|
||||
using System;
|
||||
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
internal static class BridgeConnector
|
||||
{
|
||||
private static Socket _socket;
|
||||
private static object _syncRoot = new Object();
|
||||
|
||||
public static Socket Socket
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_socket == null && HybridSupport.IsElectronActive)
|
||||
{
|
||||
lock (_syncRoot)
|
||||
{
|
||||
if (_socket == null && HybridSupport.IsElectronActive)
|
||||
{
|
||||
_socket = IO.Socket("http://localhost:" + BridgeSettings.SocketPort);
|
||||
_socket.On(Socket.EVENT_CONNECT, () =>
|
||||
{
|
||||
Console.WriteLine("BridgeConnector connected!");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(_socket == null && !HybridSupport.IsElectronActive)
|
||||
{
|
||||
lock (_syncRoot)
|
||||
{
|
||||
if (_socket == null && !HybridSupport.IsElectronActive)
|
||||
{
|
||||
_socket = IO.Socket(new Uri("http://localhost"), new IO.Options { AutoConnect = false });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _socket;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class BridgeSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the socket port.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The socket port.
|
||||
/// </value>
|
||||
public static string SocketPort { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the web port.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The web port.
|
||||
/// </value>
|
||||
public static string WebPort { get; internal set; }
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,63 +0,0 @@
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
/// <summary>
|
||||
/// The Electron.NET API
|
||||
/// </summary>
|
||||
public static class Electron
|
||||
{
|
||||
/// <summary>
|
||||
/// Communicate asynchronously from the main process to renderer processes.
|
||||
/// </summary>
|
||||
public static IpcMain IpcMain { get { return IpcMain.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Control your application's event lifecycle.
|
||||
/// </summary>
|
||||
public static App App { get { return App.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Control your windows.
|
||||
/// </summary>
|
||||
public static WindowManager WindowManager { get { return WindowManager.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Create native application menus and context menus.
|
||||
/// </summary>
|
||||
public static Menu Menu { get { return Menu.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Display native system dialogs for opening and saving files, alerting, etc.
|
||||
/// </summary>
|
||||
public static Dialog Dialog { get { return Dialog.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Create OS desktop notifications
|
||||
/// </summary>
|
||||
public static Notification Notification { get { return Notification.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Add icons and context menus to the system’s notification area.
|
||||
/// </summary>
|
||||
public static Tray Tray { get { return Tray.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Detect keyboard events when the application does not have keyboard focus.
|
||||
/// </summary>
|
||||
public static GlobalShortcut GlobalShortcut { get { return GlobalShortcut.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Manage files and URLs using their default applications.
|
||||
/// </summary>
|
||||
public static Shell Shell { get { return Shell.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve information about screen size, displays, cursor position, etc.
|
||||
/// </summary>
|
||||
public static Screen Screen { get { return Screen.Instance; } }
|
||||
|
||||
/// <summary>
|
||||
/// Perform copy and paste operations on the system clipboard.
|
||||
/// </summary>
|
||||
public static Clipboard Clipboard { get { return Clipboard.Instance; } }
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageOutputPath>..\artifacts</PackageOutputPath>
|
||||
<PackageId>ElectronNET.API</PackageId>
|
||||
<Authors>Gregor Biswanger, Robert Muehsig</Authors>
|
||||
<Company />
|
||||
<Product>Electron.NET</Product>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/ElectronNET/Electron.NET/</PackageProjectUrl>
|
||||
<Description>Building cross platform electron based desktop apps with .NET Core and ASP.NET NET Core.
|
||||
This package contains the API to access the "native" electron API.</Description>
|
||||
<RepositoryUrl>https://github.com/ElectronNET/Electron.NET/</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<PackageTags>electron aspnetcore</PackageTags>
|
||||
<PackageReleaseNotes>Changelog: https://github.com/ElectronNET/Electron.NET/blob/master/Changelog.md</PackageReleaseNotes>
|
||||
<PackageIconUrl>https://raw.githubusercontent.com/ElectronNET/Electron.NET/master/assets/images/electron.net-logo-square.png</PackageIconUrl>
|
||||
<Version>1.0.0.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile>bin\Debug\netcoreapp2.0\ElectronNET.API.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DocumentationFile>bin\Release\netcoreapp2.0\ElectronNET.API.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile>bin\Debug\netcoreapp2.0\ElectronNET.API.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
|
||||
<Exec Command="$(ProjectDir)devCleanup.cmd" IgnoreExitCode="true" />
|
||||
</Target>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' != 'Windows_NT'">
|
||||
<Exec Command="$(ProjectDir)devCleanup.sh" IgnoreExitCode="true" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SocketIoClientDotNet" Version="1.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,18 +0,0 @@
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum DockBounceType
|
||||
{
|
||||
/// <summary>
|
||||
/// The critical
|
||||
/// </summary>
|
||||
critical,
|
||||
|
||||
/// <summary>
|
||||
/// The informational
|
||||
/// </summary>
|
||||
informational
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class Error
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the stack.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The stack.
|
||||
/// </value>
|
||||
public string Stack { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum HighlightMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Highlight the tray icon when it is clicked and also when its context menu is open. This is the default.
|
||||
/// </summary>
|
||||
selection,
|
||||
|
||||
/// <summary>
|
||||
/// Always highlight the tray icon.
|
||||
/// </summary>
|
||||
always,
|
||||
|
||||
/// <summary>
|
||||
/// Never highlight the tray icon.
|
||||
/// </summary>
|
||||
never,
|
||||
|
||||
/// <summary>
|
||||
/// Activate highlight the tray icon.
|
||||
/// </summary>
|
||||
on,
|
||||
|
||||
/// <summary>
|
||||
/// Deactivate highlight the tray icon.
|
||||
/// </summary>
|
||||
off
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class LoginItemSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// true if the app is set to open at login.
|
||||
/// </summary>
|
||||
public bool OpenAtLogin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// true if the app is set to open as hidden at login. This setting is only
|
||||
/// supported on macOS.
|
||||
/// </summary>
|
||||
public bool OpenAsHidden { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// true if the app was opened at login automatically. This setting is only
|
||||
/// supported on macOS.
|
||||
/// </summary>
|
||||
public bool WasOpenedAtLogin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// true if the app was opened as a hidden login item. This indicates that the app
|
||||
/// should not open any windows at startup.This setting is only supported on macOS.
|
||||
/// </summary>
|
||||
public bool WasOpenedAsHidden { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// true if the app was opened as a login item that should restore the state from
|
||||
/// the previous session.This indicates that the app should restore the windows
|
||||
/// that were open the last time the app was closed.This setting is only supported
|
||||
/// on macOS.
|
||||
/// </summary>
|
||||
public bool RestoreState { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
// TODO: Need some of real code :)
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class NativeImage
|
||||
{
|
||||
// public static NativeImage CreateEmpty()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public static NativeImage CreateFromBuffer(byte[] buffer)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public static NativeImage CreateFromBuffer(byte[] buffer, CreateFromBufferOptions options)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public static NativeImage CreateFromDataURL(string dataURL)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public static NativeImage CreateFromPath(string path)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public void AddRepresentation(AddRepresentationOptions options)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public NativeImage Crop(Rectangle rect)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public int GetAspectRatio()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public byte[] GetBitmap()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public byte[] GetBitmap(BitmapOptions options)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public byte[] GetNativeHandle()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public Size GetSize()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public bool IsEmpty()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public bool IsTemplateImage()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public NativeImage Resize(ResizeOptions options)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public void SetTemplateImage(bool option)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public byte[] ToBitmap(ToBitmapOptions options)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public string ToDataURL(ToDataURLOptions options)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public byte[] ToJPEG(int quality)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public byte[] ToPNG(ToPNGOptions options)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class OpenExternalOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// true to bring the opened application to the foreground. The default is true.
|
||||
/// </summary>
|
||||
[DefaultValue(true)]
|
||||
public bool Activate { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class PrintToPDFOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the type of margins to use. Uses 0 for default margin, 1 for no
|
||||
/// margin, and 2 for minimum margin.
|
||||
/// </summary>
|
||||
public int MarginsType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Specify page size of the generated PDF. Can be A3, A4, A5, Legal, Letter,
|
||||
/// Tabloid or an Object containing height and width in microns.
|
||||
/// </summary>
|
||||
public string PageSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether to print CSS backgrounds.
|
||||
/// </summary>
|
||||
public bool PrintBackground { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether to print selection only.
|
||||
/// </summary>
|
||||
public bool PrintSelectionOnly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// true for landscape, false for portrait.
|
||||
/// </summary>
|
||||
public bool Landscape { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class ProcessMetric
|
||||
{
|
||||
/// <summary>
|
||||
/// CPU usage of the process.
|
||||
/// </summary>
|
||||
public CPUUsage Cpu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Memory information for the process.
|
||||
/// </summary>
|
||||
public MemoryInfo Memory {get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// Process id of the process.
|
||||
/// </summary>
|
||||
public int Pid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Process type (Browser or Tab or GPU etc).
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
using ElectronNET.API.Entities;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieve information about screen size, displays, cursor position, etc.
|
||||
/// </summary>
|
||||
public sealed class Screen
|
||||
{
|
||||
/// <summary>
|
||||
/// Emitted when an new Display has been added.
|
||||
/// </summary>
|
||||
public event Action<Display> OnDisplayAdded
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_onDisplayAdded == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("screen-display-added-event" + GetHashCode(), (display) =>
|
||||
{
|
||||
_onDisplayAdded(((JObject)display).ToObject<Display>());
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-screen-display-added", GetHashCode());
|
||||
}
|
||||
_onDisplayAdded += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_onDisplayAdded -= value;
|
||||
|
||||
if (_onDisplayAdded == null)
|
||||
BridgeConnector.Socket.Off("screen-display-added-event" + GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
private event Action<Display> _onDisplayAdded;
|
||||
|
||||
/// <summary>
|
||||
/// Emitted when oldDisplay has been removed.
|
||||
/// </summary>
|
||||
public event Action<Display> OnDisplayRemoved
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_onDisplayRemoved == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("screen-display-removed-event" + GetHashCode(), (display) =>
|
||||
{
|
||||
_onDisplayRemoved(((JObject)display).ToObject<Display>());
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-screen-display-removed", GetHashCode());
|
||||
}
|
||||
_onDisplayRemoved += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_onDisplayRemoved -= value;
|
||||
|
||||
if (_onDisplayRemoved == null)
|
||||
BridgeConnector.Socket.Off("screen-display-removed-event" + GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
private event Action<Display> _onDisplayRemoved;
|
||||
|
||||
/// <summary>
|
||||
/// Emitted when one or more metrics change in a display.
|
||||
/// The changedMetrics is an array of strings that describe the changes.
|
||||
/// Possible changes are bounds, workArea, scaleFactor and rotation.
|
||||
/// </summary>
|
||||
public event Action<Display, string[]> OnDisplayMetricsChanged
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_onDisplayMetricsChanged == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("screen-display-metrics-changed-event" + GetHashCode(), (args) =>
|
||||
{
|
||||
var display = ((JArray)args).First.ToObject<Display>();
|
||||
var metrics = ((JArray)args).Last.ToObject<string[]>();
|
||||
|
||||
_onDisplayMetricsChanged(display, metrics);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-screen-display-metrics-changed", GetHashCode());
|
||||
}
|
||||
_onDisplayMetricsChanged += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_onDisplayMetricsChanged -= value;
|
||||
|
||||
if (_onDisplayMetricsChanged == null)
|
||||
BridgeConnector.Socket.Off("screen-display-metrics-changed-event" + GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
private event Action<Display, string[]> _onDisplayMetricsChanged;
|
||||
|
||||
private static Screen _screen;
|
||||
private static object _syncRoot = new Object();
|
||||
|
||||
internal Screen() { }
|
||||
|
||||
internal static Screen Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_screen == null)
|
||||
{
|
||||
lock (_syncRoot)
|
||||
{
|
||||
if (_screen == null)
|
||||
{
|
||||
_screen = new Screen();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _screen;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The current absolute position of the mouse pointer.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task<Point> GetCursorScreenPointAsync()
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<Point>();
|
||||
|
||||
BridgeConnector.Socket.On("screen-getCursorScreenPointCompleted", (point) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("screen-getCursorScreenPointCompleted");
|
||||
|
||||
taskCompletionSource.SetResult(((JObject)point).ToObject<Point>());
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("screen-getCursorScreenPoint");
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// macOS: The height of the menu bar in pixels.
|
||||
/// </summary>
|
||||
/// <returns>The height of the menu bar in pixels.</returns>
|
||||
public Task<int> GetMenuBarHeightAsync()
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<int>();
|
||||
|
||||
BridgeConnector.Socket.On("screen-getMenuBarHeightCompleted", (height) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("screen-getMenuBarHeightCompleted");
|
||||
|
||||
taskCompletionSource.SetResult(int.Parse(height.ToString()));
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("screen-getMenuBarHeight");
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The primary display.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task<Display> GetPrimaryDisplayAsync()
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<Display>();
|
||||
|
||||
BridgeConnector.Socket.On("screen-getPrimaryDisplayCompleted", (display) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("screen-getPrimaryDisplayCompleted");
|
||||
|
||||
taskCompletionSource.SetResult(((JObject)display).ToObject<Display>());
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("screen-getPrimaryDisplay");
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An array of displays that are currently available.
|
||||
/// </summary>
|
||||
/// <returns>An array of displays that are currently available.</returns>
|
||||
public Task<Display[]> GetAllDisplaysAsync()
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<Display[]>();
|
||||
|
||||
BridgeConnector.Socket.On("screen-getAllDisplaysCompleted", (displays) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("screen-getAllDisplaysCompleted");
|
||||
|
||||
taskCompletionSource.SetResult(((JArray)displays).ToObject<Display[]>());
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("screen-getAllDisplays");
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The display nearest the specified point.
|
||||
/// </summary>
|
||||
/// <returns>The display nearest the specified point.</returns>
|
||||
public Task<Display> GetDisplayNearestPointAsync(Point point)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<Display>();
|
||||
|
||||
BridgeConnector.Socket.On("screen-getDisplayNearestPointCompleted", (display) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("screen-getDisplayNearestPointCompleted");
|
||||
|
||||
taskCompletionSource.SetResult(((JObject)display).ToObject<Display>());
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("screen-getDisplayNearestPoint", JObject.FromObject(point, _jsonSerializer));
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The display that most closely intersects the provided bounds.
|
||||
/// </summary>
|
||||
/// <param name="rectangle"></param>
|
||||
/// <returns>The display that most closely intersects the provided bounds.</returns>
|
||||
public Task<Display> GetDisplayMatchingAsync(Rectangle rectangle)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<Display>();
|
||||
|
||||
BridgeConnector.Socket.On("screen-getDisplayMatching", (display) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("screen-getDisplayMatching");
|
||||
|
||||
taskCompletionSource.SetResult(((JObject)display).ToObject<Display>());
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("screen-getDisplayMatching", JObject.FromObject(rectangle, _jsonSerializer));
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
private JsonSerializer _jsonSerializer = new JsonSerializer()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
DefaultValueHandling = DefaultValueHandling.Ignore
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
using ElectronNET.API.Entities;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
/// <summary>
|
||||
/// Manage files and URLs using their default applications.
|
||||
/// </summary>
|
||||
public sealed class Shell
|
||||
{
|
||||
private static Shell _shell;
|
||||
private static object _syncRoot = new Object();
|
||||
|
||||
internal Shell() { }
|
||||
|
||||
internal static Shell Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_shell == null)
|
||||
{
|
||||
lock (_syncRoot)
|
||||
{
|
||||
if (_shell == null)
|
||||
{
|
||||
_shell = new Shell();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _shell;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show the given file in a file manager. If possible, select the file.
|
||||
/// </summary>
|
||||
/// <param name="fullPath"></param>
|
||||
/// <returns>Whether the item was successfully shown.</returns>
|
||||
public Task<bool> ShowItemInFolderAsync(string fullPath)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On("shell-showItemInFolderCompleted", (success) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("shell-showItemInFolderCompleted");
|
||||
|
||||
taskCompletionSource.SetResult((bool)success);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("shell-showItemInFolder", fullPath);
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open the given file in the desktop’s default manner.
|
||||
/// </summary>
|
||||
/// <param name="fullPath"></param>
|
||||
/// <returns>Whether the item was successfully opened.</returns>
|
||||
public Task<bool> OpenItemAsync(string fullPath)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On("shell-openItemCompleted", (success) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("shell-openItemCompleted");
|
||||
|
||||
taskCompletionSource.SetResult((bool)success);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("shell-openItem", fullPath);
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open the given external protocol URL in the desktop’s default manner.
|
||||
/// (For example, mailto: URLs in the user’s default mail agent).
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <returns>Whether an application was available to open the URL.
|
||||
/// If callback is specified, always returns true.</returns>
|
||||
public Task<bool> OpenExternalAsync(string url)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On("shell-openExternalCompleted", (success) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("shell-openExternalCompleted");
|
||||
|
||||
taskCompletionSource.SetResult((bool)success);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("shell-openExternal", url);
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open the given external protocol URL in the desktop’s default manner.
|
||||
/// (For example, mailto: URLs in the user’s default mail agent).
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="options">macOS only</param>
|
||||
/// <returns>Whether an application was available to open the URL.
|
||||
/// If callback is specified, always returns true.</returns>
|
||||
public Task<bool> OpenExternalAsync(string url, OpenExternalOptions options)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On("shell-openExternalCompleted", (success) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("shell-openExternalCompleted");
|
||||
|
||||
taskCompletionSource.SetResult((bool)success);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("shell-openExternal", url, JObject.FromObject(options, _jsonSerializer));
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open the given external protocol URL in the desktop’s default manner.
|
||||
/// (For example, mailto: URLs in the user’s default mail agent).
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="options">macOS only</param>
|
||||
/// <param name="action">macOS only</param>
|
||||
/// <returns>Whether an application was available to open the URL.
|
||||
/// If callback is specified, always returns true.</returns>
|
||||
public Task<bool> OpenExternalAsync(string url, OpenExternalOptions options, Action<Error> action)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On("shell-openExternalCompleted", (success) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("shell-openExternalCompleted");
|
||||
|
||||
taskCompletionSource.SetResult((bool)success);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Off("shell-openExternalCallback");
|
||||
BridgeConnector.Socket.On("shell-openExternalCallback", (args) => {
|
||||
var urlKey = ((JArray)args).First.ToString();
|
||||
var error = ((JArray)args).Last.ToObject<Error>();
|
||||
|
||||
if(_openExternalCallbacks.ContainsKey(urlKey))
|
||||
{
|
||||
_openExternalCallbacks[urlKey](error);
|
||||
}
|
||||
});
|
||||
|
||||
_openExternalCallbacks.Add(url, action);
|
||||
|
||||
BridgeConnector.Socket.Emit("shell-openExternal", url, JObject.FromObject(options, _jsonSerializer), true);
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
private Dictionary<string, Action<Error>> _openExternalCallbacks = new Dictionary<string, Action<Error>>();
|
||||
|
||||
/// <summary>
|
||||
/// Move the given file to trash and returns a boolean status for the operation.
|
||||
/// </summary>
|
||||
/// <param name="fullPath"></param>
|
||||
/// <returns> Whether the item was successfully moved to the trash.</returns>
|
||||
public Task<bool> MoveItemToTrashAsync(string fullPath)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On("shell-moveItemToTrashCompleted", (success) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("shell-moveItemToTrashCompleted");
|
||||
|
||||
taskCompletionSource.SetResult((bool)success);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("shell-moveItemToTrash", fullPath);
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Play the beep sound.
|
||||
/// </summary>
|
||||
public void Beep()
|
||||
{
|
||||
BridgeConnector.Socket.Emit("shell-beep");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates or updates a shortcut link at shortcutPath.
|
||||
/// </summary>
|
||||
/// <param name="shortcutPath"></param>
|
||||
/// <param name="operation"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns>Whether the shortcut was created successfully.</returns>
|
||||
public Task<bool> WriteShortcutLinkAsync(string shortcutPath, ShortcutLinkOperation operation, ShortcutDetails options)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On("shell-writeShortcutLinkCompleted", (success) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("shell-writeShortcutLinkCompleted");
|
||||
|
||||
taskCompletionSource.SetResult((bool)success);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("shell-writeShortcutLink", shortcutPath, operation.ToString(), JObject.FromObject(options, _jsonSerializer));
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resolves the shortcut link at shortcutPath.
|
||||
///
|
||||
/// An exception will be thrown when any error happens.
|
||||
/// </summary>
|
||||
/// <param name="shortcutPath"></param>
|
||||
/// <returns></returns>
|
||||
public Task<ShortcutDetails> ReadShortcutLinkAsync(string shortcutPath)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<ShortcutDetails>();
|
||||
|
||||
BridgeConnector.Socket.On("shell-readShortcutLinkCompleted", (shortcutDetails) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("shell-readShortcutLinkCompleted");
|
||||
|
||||
taskCompletionSource.SetResult((ShortcutDetails)shortcutDetails);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("shell-readShortcutLink", shortcutPath);
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
private JsonSerializer _jsonSerializer = new JsonSerializer()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
DefaultValueHandling = DefaultValueHandling.Ignore
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,358 +0,0 @@
|
||||
using ElectronNET.API.Entities;
|
||||
using ElectronNET.API.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
/// <summary>
|
||||
/// Add icons and context menus to the system's notification area.
|
||||
/// </summary>
|
||||
public sealed class Tray
|
||||
{
|
||||
/// <summary>
|
||||
/// Emitted when the tray icon is clicked.
|
||||
/// </summary>
|
||||
public event Action<TrayClickEventArgs, Rectangle> OnClick
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_click == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("tray-click-event" + GetHashCode(), (result) =>
|
||||
{
|
||||
var args = ((JArray)result).ToObject<object[]>();
|
||||
var trayClickEventArgs = ((JObject)args[0]).ToObject<TrayClickEventArgs>();
|
||||
var bounds = ((JObject)args[1]).ToObject<Rectangle>();
|
||||
_click(trayClickEventArgs, bounds);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-tray-click", GetHashCode());
|
||||
}
|
||||
_click += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_click -= value;
|
||||
|
||||
if (_click == null)
|
||||
BridgeConnector.Socket.Off("tray-click-event" + GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
private event Action<TrayClickEventArgs, Rectangle> _click;
|
||||
|
||||
/// <summary>
|
||||
/// macOS, Windows: Emitted when the tray icon is right clicked.
|
||||
/// </summary>
|
||||
public event Action<TrayClickEventArgs, Rectangle> OnRightClick
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_rightClick == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("tray-right-click-event" + GetHashCode(), (result) =>
|
||||
{
|
||||
var args = ((JArray)result).ToObject<object[]>();
|
||||
var trayClickEventArgs = ((JObject)args[0]).ToObject<TrayClickEventArgs>();
|
||||
var bounds = ((JObject)args[1]).ToObject<Rectangle>();
|
||||
_rightClick(trayClickEventArgs, bounds);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-tray-right-click", GetHashCode());
|
||||
}
|
||||
_rightClick += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_rightClick -= value;
|
||||
|
||||
if (_rightClick == null)
|
||||
BridgeConnector.Socket.Off("tray-right-click-event" + GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
private event Action<TrayClickEventArgs, Rectangle> _rightClick;
|
||||
|
||||
/// <summary>
|
||||
/// macOS, Windows: Emitted when the tray icon is double clicked.
|
||||
/// </summary>
|
||||
public event Action<TrayClickEventArgs, Rectangle> OnDoubleClick
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_doubleClick == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("tray-double-click-event" + GetHashCode(), (result) =>
|
||||
{
|
||||
var args = ((JArray)result).ToObject<object[]>();
|
||||
var trayClickEventArgs = ((JObject)args[0]).ToObject<TrayClickEventArgs>();
|
||||
var bounds = ((JObject)args[1]).ToObject<Rectangle>();
|
||||
_doubleClick(trayClickEventArgs, bounds);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-tray-double-click", GetHashCode());
|
||||
}
|
||||
_doubleClick += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_doubleClick -= value;
|
||||
|
||||
if (_doubleClick == null)
|
||||
BridgeConnector.Socket.Off("tray-double-click-event" + GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
private event Action<TrayClickEventArgs, Rectangle> _doubleClick;
|
||||
|
||||
/// <summary>
|
||||
/// Windows: Emitted when the tray balloon shows.
|
||||
/// </summary>
|
||||
public event Action OnBalloonShow
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_balloonShow == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("tray-balloon-show-event" + GetHashCode(), () =>
|
||||
{
|
||||
_balloonShow();
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-tray-balloon-show", GetHashCode());
|
||||
}
|
||||
_balloonShow += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_balloonShow -= value;
|
||||
|
||||
if (_balloonShow == null)
|
||||
BridgeConnector.Socket.Off("tray-balloon-show-event" + GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
private event Action _balloonShow;
|
||||
|
||||
/// <summary>
|
||||
/// Windows: Emitted when the tray balloon is clicked.
|
||||
/// </summary>
|
||||
public event Action OnBalloonClick
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_balloonClick == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("tray-balloon-click-event" + GetHashCode(), () =>
|
||||
{
|
||||
_balloonClick();
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-tray-balloon-click", GetHashCode());
|
||||
}
|
||||
_balloonClick += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_balloonClick -= value;
|
||||
|
||||
if (_balloonClick == null)
|
||||
BridgeConnector.Socket.Off("tray-balloon-click-event" + GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
private event Action _balloonClick;
|
||||
|
||||
/// <summary>
|
||||
/// Windows: Emitted when the tray balloon is closed
|
||||
/// because of timeout or user manually closes it.
|
||||
/// </summary>
|
||||
public event Action OnBalloonClosed
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_balloonClosed == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("tray-balloon-closed-event" + GetHashCode(), () =>
|
||||
{
|
||||
_balloonClosed();
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-tray-balloon-closed", GetHashCode());
|
||||
}
|
||||
_balloonClosed += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_balloonClosed -= value;
|
||||
|
||||
if (_balloonClosed == null)
|
||||
BridgeConnector.Socket.Off("tray-balloon-closed-event" + GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
private event Action _balloonClosed;
|
||||
|
||||
// TODO: Implement macOS Events
|
||||
|
||||
private static Tray _tray;
|
||||
private static object _syncRoot = new Object();
|
||||
|
||||
internal Tray() { }
|
||||
|
||||
internal static Tray Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_tray == null)
|
||||
{
|
||||
lock (_syncRoot)
|
||||
{
|
||||
if (_tray == null)
|
||||
{
|
||||
_tray = new Tray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _tray;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the menu items.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The menu items.
|
||||
/// </value>
|
||||
public IReadOnlyCollection<MenuItem> MenuItems { get { return _items.AsReadOnly(); } }
|
||||
private List<MenuItem> _items = new List<MenuItem>();
|
||||
|
||||
/// <summary>
|
||||
/// Shows the Traybar.
|
||||
/// </summary>
|
||||
/// <param name="image">The image.</param>
|
||||
/// <param name="menuItem">The menu item.</param>
|
||||
public void Show(string image, MenuItem menuItem)
|
||||
{
|
||||
Show(image, new MenuItem[] { menuItem });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the Traybar.
|
||||
/// </summary>
|
||||
/// <param name="image">The image.</param>
|
||||
/// <param name="menuItems">The menu items.</param>
|
||||
public void Show(string image, MenuItem[] menuItems)
|
||||
{
|
||||
menuItems.AddMenuItemsId();
|
||||
BridgeConnector.Socket.Emit("create-tray", image, JArray.FromObject(menuItems, _jsonSerializer));
|
||||
_items.AddRange(menuItems);
|
||||
|
||||
BridgeConnector.Socket.Off("trayMenuItemClicked");
|
||||
BridgeConnector.Socket.On("trayMenuItemClicked", (id) =>
|
||||
{
|
||||
MenuItem menuItem = _items.GetMenuItem(id.ToString());
|
||||
menuItem?.Click();
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destroys the tray icon immediately.
|
||||
/// </summary>
|
||||
public void Destroy()
|
||||
{
|
||||
BridgeConnector.Socket.Emit("tray-destroy");
|
||||
_items.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image associated with this tray icon.
|
||||
/// </summary>
|
||||
/// <param name="image"></param>
|
||||
public void SetImage(string image)
|
||||
{
|
||||
BridgeConnector.Socket.Emit("tray-setImage", image);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image associated with this tray icon when pressed on macOS.
|
||||
/// </summary>
|
||||
/// <param name="image"></param>
|
||||
public void SetPressedImage(string image)
|
||||
{
|
||||
BridgeConnector.Socket.Emit("tray-setPressedImage", image);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the hover text for this tray icon.
|
||||
/// </summary>
|
||||
/// <param name="toolTip"></param>
|
||||
public void SetToolTip(string toolTip)
|
||||
{
|
||||
BridgeConnector.Socket.Emit("tray-setToolTip", toolTip);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// macOS: Sets the title displayed aside of the tray icon in the status bar.
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
public void SetTitle(string title)
|
||||
{
|
||||
BridgeConnector.Socket.Emit("tray-setTitle", title);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// macOS: Sets when the tray’s icon background becomes highlighted (in blue).
|
||||
///
|
||||
/// Note: You can use highlightMode with a BrowserWindow by toggling between
|
||||
/// 'never' and 'always' modes when the window visibility changes.
|
||||
/// </summary>
|
||||
/// <param name="highlightMode"></param>
|
||||
public void SetHighlightMode(HighlightMode highlightMode)
|
||||
{
|
||||
BridgeConnector.Socket.Emit("tray-setHighlightMode", highlightMode.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Windows: Displays a tray balloon.
|
||||
/// </summary>
|
||||
/// <param name="options"></param>
|
||||
public void DisplayBalloon(DisplayBalloonOptions options)
|
||||
{
|
||||
BridgeConnector.Socket.Emit("tray-displayBalloon", JObject.FromObject(options, _jsonSerializer));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether the tray icon is destroyed.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task<bool> IsDestroyedAsync()
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On("tray-isDestroyedCompleted", (isDestroyed) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("tray-isDestroyedCompleted");
|
||||
|
||||
taskCompletionSource.SetResult((bool)isDestroyed);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("tray-isDestroyed");
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
private JsonSerializer _jsonSerializer = new JsonSerializer()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
DefaultValueHandling = DefaultValueHandling.Ignore
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
using ElectronNET.API.Entities;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
/// <summary>
|
||||
/// Render and control web pages.
|
||||
/// </summary>
|
||||
public class WebContents
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the identifier.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The identifier.
|
||||
/// </value>
|
||||
public int Id { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Emitted when the renderer process crashes or is killed.
|
||||
/// </summary>
|
||||
public event Action<bool> OnCrashed
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_crashed == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("webContents-crashed" + Id, (killed) =>
|
||||
{
|
||||
_crashed((bool)killed);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-webContents-crashed", Id);
|
||||
}
|
||||
_crashed += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_crashed -= value;
|
||||
|
||||
if (_crashed == null)
|
||||
BridgeConnector.Socket.Off("webContents-crashed" + Id);
|
||||
}
|
||||
}
|
||||
|
||||
private event Action<bool> _crashed;
|
||||
|
||||
/// <summary>
|
||||
/// Emitted when the navigation is done, i.e. the spinner of the tab has
|
||||
/// stopped spinning, and the onload event was dispatched.
|
||||
/// </summary>
|
||||
public event Action OnDidFinishLoad
|
||||
{
|
||||
add
|
||||
{
|
||||
if (_didFinishLoad == null)
|
||||
{
|
||||
BridgeConnector.Socket.On("webContents-didFinishLoad" + Id, () =>
|
||||
{
|
||||
_didFinishLoad();
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("register-webContents-didFinishLoad", Id);
|
||||
}
|
||||
_didFinishLoad += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_didFinishLoad -= value;
|
||||
|
||||
if (_didFinishLoad == null)
|
||||
BridgeConnector.Socket.Off("webContents-didFinishLoad" + Id);
|
||||
}
|
||||
}
|
||||
|
||||
private event Action _didFinishLoad;
|
||||
|
||||
internal WebContents(int id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the devtools.
|
||||
/// </summary>
|
||||
public void OpenDevTools()
|
||||
{
|
||||
BridgeConnector.Socket.Emit("webContentsOpenDevTools", Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the devtools.
|
||||
/// </summary>
|
||||
/// <param name="openDevToolsOptions"></param>
|
||||
public void OpenDevTools(OpenDevToolsOptions openDevToolsOptions)
|
||||
{
|
||||
BridgeConnector.Socket.Emit("webContentsOpenDevTools", Id, JObject.FromObject(openDevToolsOptions, _jsonSerializer));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prints window's web page as PDF with Chromium's preview printing custom
|
||||
/// settings.The landscape will be ignored if @page CSS at-rule is used in the web page.
|
||||
/// By default, an empty options will be regarded as: Use page-break-before: always;
|
||||
/// CSS style to force to print to a new page.
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns>success</returns>
|
||||
public Task<bool> PrintToPDFAsync(string path, PrintToPDFOptions options = null)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On("webContents-printToPDF-completed", (success) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("webContents-printToPDF-completed");
|
||||
taskCompletionSource.SetResult((bool)success);
|
||||
});
|
||||
|
||||
if(options == null)
|
||||
{
|
||||
BridgeConnector.Socket.Emit("webContents-printToPDF", Id, "", path);
|
||||
}
|
||||
else
|
||||
{
|
||||
BridgeConnector.Socket.Emit("webContents-printToPDF", Id, JObject.FromObject(options, _jsonSerializer), path);
|
||||
}
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is used to get the Url of the loaded page.
|
||||
/// It's usefull if a web-server redirects you and you need to know where it redirects. For instance, It's useful in case of Implicit Authorization.
|
||||
/// </summary>
|
||||
/// <returns>URL of the loaded page</returns>
|
||||
public Task<string> GetUrl()
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<string>();
|
||||
|
||||
var eventString = "webContents-getUrl" + Id;
|
||||
BridgeConnector.Socket.On(eventString, (url) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off(eventString);
|
||||
taskCompletionSource.SetResult((string)url);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("webContents-getUrl", Id);
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
private JsonSerializer _jsonSerializer = new JsonSerializer()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
DefaultValueHandling = DefaultValueHandling.Ignore
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System;
|
||||
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class WebHostBuilderExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Use a Electron support for this .NET Core Project.
|
||||
/// </summary>
|
||||
/// <param name="builder">The builder.</param>
|
||||
/// <param name="args">The arguments.</param>
|
||||
/// <returns></returns>
|
||||
public static IWebHostBuilder UseElectron(this IWebHostBuilder builder, string[] args)
|
||||
{
|
||||
foreach (string argument in args)
|
||||
{
|
||||
if (argument.ToUpper().Contains("ELECTRONPORT"))
|
||||
{
|
||||
BridgeSettings.SocketPort = argument.ToUpper().Replace("/ELECTRONPORT=", "");
|
||||
Console.WriteLine("Use Electron Port: " + BridgeSettings.SocketPort);
|
||||
} else if(argument.ToUpper().Contains("ELECTRONWEBPORT"))
|
||||
{
|
||||
BridgeSettings.WebPort = argument.ToUpper().Replace("/ELECTRONWEBPORT=", "");
|
||||
}
|
||||
}
|
||||
|
||||
if(HybridSupport.IsElectronActive)
|
||||
{
|
||||
builder.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory)
|
||||
.UseUrls("http://0.0.0.0:" + BridgeSettings.WebPort);
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
using ElectronNET.API.Entities;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public sealed class WindowManager
|
||||
{
|
||||
private static WindowManager _windowManager;
|
||||
private static object _syncRoot = new Object();
|
||||
|
||||
internal WindowManager() { }
|
||||
|
||||
internal static WindowManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_windowManager == null)
|
||||
{
|
||||
lock (_syncRoot)
|
||||
{
|
||||
if (_windowManager == null)
|
||||
{
|
||||
_windowManager = new WindowManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _windowManager;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Quit when all windows are closed. (Default is true)
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if [quit window all closed]; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public bool IsQuitOnWindowAllClosed
|
||||
{
|
||||
get { return _isQuitOnWindowAllClosed; }
|
||||
set
|
||||
{
|
||||
BridgeConnector.Socket.Emit("quit-app-window-all-closed-event", value);
|
||||
_isQuitOnWindowAllClosed = value;
|
||||
}
|
||||
}
|
||||
private bool _isQuitOnWindowAllClosed = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the browser windows.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The browser windows.
|
||||
/// </value>
|
||||
public IReadOnlyCollection<BrowserWindow> BrowserWindows { get { return _browserWindows.AsReadOnly(); } }
|
||||
private List<BrowserWindow> _browserWindows = new List<BrowserWindow>();
|
||||
|
||||
/// <summary>
|
||||
/// Creates the window asynchronous.
|
||||
/// </summary>
|
||||
/// <param name="loadUrl">The load URL.</param>
|
||||
/// <returns></returns>
|
||||
public async Task<BrowserWindow> CreateWindowAsync(string loadUrl = "http://localhost")
|
||||
{
|
||||
return await CreateWindowAsync(new BrowserWindowOptions(), loadUrl);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the window asynchronous.
|
||||
/// </summary>
|
||||
/// <param name="options">The options.</param>
|
||||
/// <param name="loadUrl">The load URL.</param>
|
||||
/// <returns></returns>
|
||||
public Task<BrowserWindow> CreateWindowAsync(BrowserWindowOptions options, string loadUrl = "http://localhost")
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<BrowserWindow>();
|
||||
|
||||
BridgeConnector.Socket.On("BrowserWindowCreated", (id) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("BrowserWindowCreated");
|
||||
|
||||
string windowId = id.ToString();
|
||||
BrowserWindow browserWindow = new BrowserWindow(int.Parse(windowId));
|
||||
_browserWindows.Add(browserWindow);
|
||||
|
||||
taskCompletionSource.SetResult(browserWindow);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Off("BrowserWindowClosed");
|
||||
BridgeConnector.Socket.On("BrowserWindowClosed", (ids) =>
|
||||
{
|
||||
var browserWindowIds = ((JArray)ids).ToObject<int[]>();
|
||||
|
||||
for (int index = 0; index < _browserWindows.Count; index++)
|
||||
{
|
||||
if (!browserWindowIds.Contains(_browserWindows[index].Id))
|
||||
{
|
||||
_browserWindows.RemoveAt(index);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (loadUrl.ToUpper() == "HTTP://LOCALHOST")
|
||||
{
|
||||
loadUrl = $"{loadUrl}:{BridgeSettings.WebPort}";
|
||||
}
|
||||
|
||||
BridgeConnector.Socket.Emit("createBrowserWindow", JObject.FromObject(options, _jsonSerializer), loadUrl);
|
||||
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
private JsonSerializer _jsonSerializer = new JsonSerializer()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
DefaultValueHandling = DefaultValueHandling.Ignore
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
rd /s /q %userprofile%\.nuget\packages\electronnet.api 2>nul
|
||||
@@ -1 +0,0 @@
|
||||
rm -rf ~/.nuget/packages/electronnet.api
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace ElectronNET.CLI.Commands.Actions
|
||||
{
|
||||
public static class DeployEmbeddedElectronFiles
|
||||
{
|
||||
public static void Do(string tempPath)
|
||||
{
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "main.js");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package.json");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package-lock.json");
|
||||
|
||||
string hostApiFolder = Path.Combine(tempPath, "api");
|
||||
if (Directory.Exists(hostApiFolder) == false)
|
||||
{
|
||||
Directory.CreateDirectory(hostApiFolder);
|
||||
}
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "ipc.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "app.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "browserWindows.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "dialog.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "menu.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "notification.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "tray.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "webContents.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "globalShortcut.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "shell.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "screen.js", "api.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "clipboard.js", "api.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace ElectronNET.CLI.Commands.Actions
|
||||
{
|
||||
public static class GetTargetPlatformInformation
|
||||
{
|
||||
public struct GetTargetPlatformInformationResult
|
||||
{
|
||||
public string NetCorePublishRid { get; set; }
|
||||
public string ElectronPackerPlatform { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public static GetTargetPlatformInformationResult Do(string desiredPlatform, string specifiedPlatfromFromCustom)
|
||||
{
|
||||
string netCorePublishRid = string.Empty;
|
||||
string electronPackerPlatform = string.Empty;
|
||||
|
||||
switch (desiredPlatform)
|
||||
{
|
||||
case "win":
|
||||
netCorePublishRid = "win-x64";
|
||||
electronPackerPlatform = "win32";
|
||||
break;
|
||||
case "osx":
|
||||
netCorePublishRid = "osx-x64";
|
||||
electronPackerPlatform = "darwin";
|
||||
break;
|
||||
case "linux":
|
||||
netCorePublishRid = "linux-x64";
|
||||
electronPackerPlatform = "linux";
|
||||
break;
|
||||
case "linux-arm":
|
||||
netCorePublishRid = "linux-arm";
|
||||
electronPackerPlatform = "linux";
|
||||
break;
|
||||
case "custom":
|
||||
var splittedSpecified = specifiedPlatfromFromCustom.Split(';');
|
||||
netCorePublishRid = splittedSpecified[0];
|
||||
electronPackerPlatform = splittedSpecified[1];
|
||||
break;
|
||||
default:
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
netCorePublishRid = "win-x64";
|
||||
electronPackerPlatform = "win32";
|
||||
}
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
netCorePublishRid = "osx-x64";
|
||||
electronPackerPlatform = "darwin";
|
||||
}
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
netCorePublishRid = "linux-x64";
|
||||
electronPackerPlatform = "linux";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return new GetTargetPlatformInformationResult()
|
||||
{
|
||||
ElectronPackerPlatform = electronPackerPlatform,
|
||||
NetCorePublishRid = netCorePublishRid
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ElectronNET.CLI.Commands.Actions;
|
||||
|
||||
namespace ElectronNET.CLI.Commands
|
||||
{
|
||||
public class BuildCommand : ICommand
|
||||
{
|
||||
public const string COMMAND_NAME = "build";
|
||||
public const string COMMAND_DESCRIPTION = "Build your Electron Application.";
|
||||
public static string COMMAND_ARGUMENTS = "Needed: '/target' with params 'win/osx/linux' to build for a typical app or use 'custom' and specify .NET Core build config & electron build config" + Environment.NewLine +
|
||||
" for custom target, check .NET Core RID Catalog and Electron build target/" + Environment.NewLine +
|
||||
" e.g. '/target win' or '/target custom \"win7-x86;win32\"'" + Environment.NewLine +
|
||||
"Optional: '/dotnet-configuration' with the desired .NET Core build config e.g. release or debug. Default = Release" + Environment.NewLine +
|
||||
"Optional: '/electron-arch' to specify the resulting electron processor architecture (e.g. ia86 for x86 builds). Be aware to use the '/target custom' param as well!" + Environment.NewLine +
|
||||
"Optional: '/electron-params' specify any other valid parameter, which will be routed to the electron-packager." + Environment.NewLine +
|
||||
"Full example for a 32bit debug build with electron prune: build /target custom win7-x86;win32 /dotnet-configuration Debug /electron-arch ia32 /electron-params \"--prune=true \"";
|
||||
|
||||
public static IList<CommandOption> CommandOptions { get; set; } = new List<CommandOption>();
|
||||
|
||||
private string[] _args;
|
||||
|
||||
public BuildCommand(string[] args)
|
||||
{
|
||||
_args = args;
|
||||
}
|
||||
|
||||
private string _paramTarget = "target";
|
||||
private string _paramDotNetConfig = "dotnet-configuration";
|
||||
private string _paramElectronArch = "electron-arch";
|
||||
private string _paramElectronParams = "electron-params";
|
||||
|
||||
public Task<bool> ExecuteAsync()
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
Console.WriteLine("Build Electron Application...");
|
||||
|
||||
SimpleCommandLineParser parser = new SimpleCommandLineParser();
|
||||
parser.Parse(_args);
|
||||
|
||||
var desiredPlatform = parser.Arguments[_paramTarget][0];
|
||||
string specifiedFromCustom = string.Empty;
|
||||
if (desiredPlatform == "custom" && parser.Arguments[_paramTarget].Length > 1)
|
||||
{
|
||||
specifiedFromCustom = parser.Arguments[_paramTarget][1];
|
||||
}
|
||||
|
||||
string configuration = "Release";
|
||||
if (parser.Arguments.ContainsKey(_paramDotNetConfig))
|
||||
{
|
||||
configuration = parser.Arguments[_paramDotNetConfig][0];
|
||||
}
|
||||
|
||||
var platformInfo = GetTargetPlatformInformation.Do(desiredPlatform, specifiedFromCustom);
|
||||
|
||||
Console.WriteLine($"Build ASP.NET Core App for {platformInfo.NetCorePublishRid}...");
|
||||
|
||||
|
||||
string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "obj", "desktop", desiredPlatform);
|
||||
if (Directory.Exists(tempPath) == false)
|
||||
{
|
||||
Directory.CreateDirectory(tempPath);
|
||||
}
|
||||
|
||||
Console.WriteLine("Executing dotnet publish in this directory: " + tempPath);
|
||||
|
||||
string tempBinPath = Path.Combine(tempPath, "bin");
|
||||
|
||||
Console.WriteLine($"Build ASP.NET Core App for {platformInfo.NetCorePublishRid} under {configuration}-Configuration...");
|
||||
|
||||
var resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} -c {configuration} --output \"{tempBinPath}\"", Directory.GetCurrentDirectory());
|
||||
|
||||
if (resultCode != 0)
|
||||
{
|
||||
Console.WriteLine("Error occurred during dotnet publish: " + resultCode);
|
||||
return false;
|
||||
}
|
||||
|
||||
DeployEmbeddedElectronFiles.Do(tempPath);
|
||||
|
||||
var checkForNodeModulesDirPath = Path.Combine(tempPath, "node_modules");
|
||||
|
||||
if (Directory.Exists(checkForNodeModulesDirPath) == false)
|
||||
{
|
||||
Console.WriteLine("node_modules missing in: " + checkForNodeModulesDirPath);
|
||||
|
||||
Console.WriteLine("Start npm install...");
|
||||
ProcessHelper.CmdExecute("npm install", tempPath);
|
||||
|
||||
Console.WriteLine("Start npm install electron-packager...");
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
// Works proper on Windows...
|
||||
ProcessHelper.CmdExecute("npm install electron-packager --global", tempPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ToDo: find another solution or document it proper
|
||||
// GH Issue https://github.com/electron-userland/electron-prebuilt/issues/48
|
||||
Console.WriteLine("Electron Packager - make sure you invoke 'sudo npm install electron-packager --global' at " + tempPath + " manually. Sry.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Skip npm install, because node_modules directory exists in: " + checkForNodeModulesDirPath);
|
||||
}
|
||||
|
||||
Console.WriteLine("Build Electron Desktop Application...");
|
||||
string buildPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "desktop");
|
||||
|
||||
Console.WriteLine("Executing electron magic in this directory: " + buildPath);
|
||||
|
||||
// ToDo: Need a solution for --asar support
|
||||
|
||||
string electronArch = "x64";
|
||||
if (parser.Arguments.ContainsKey(_paramElectronArch))
|
||||
{
|
||||
electronArch = parser.Arguments[_paramElectronArch][0];
|
||||
}
|
||||
|
||||
string electronParams = "";
|
||||
if (parser.Arguments.ContainsKey(_paramElectronParams))
|
||||
{
|
||||
electronParams = parser.Arguments[_paramElectronParams][0];
|
||||
}
|
||||
|
||||
Console.WriteLine($"Package Electron App for Platform {platformInfo.ElectronPackerPlatform}...");
|
||||
ProcessHelper.CmdExecute($"electron-packager . --platform={platformInfo.ElectronPackerPlatform} --arch={electronArch} {electronParams} --out=\"{buildPath}\" --overwrite", tempPath);
|
||||
|
||||
Console.WriteLine("... done");
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
namespace ElectronNET.CLI.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// The definitionn of an option for a command.
|
||||
/// </summary>
|
||||
public class CommandOption
|
||||
{
|
||||
/// <summary>
|
||||
/// An enum for the possible values for an option
|
||||
/// </summary>
|
||||
public enum CommandOptionValueType { NoValue, StringValue, BoolValue, IntValue, CommaDelimitedList, KeyValuePairs }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the option.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The short form of the command line switch. This will start with just one dash e.g. -f for framework
|
||||
/// </summary>
|
||||
public string ShortSwitch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The full form of the command line switch. This will start with two dashes e.g. --framework
|
||||
/// </summary>
|
||||
public string Switch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The description of the option
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of value that is expected with this command option
|
||||
/// </summary>
|
||||
public CommandOptionValueType ValueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The JSON key used in configuration file.`
|
||||
/// </summary>
|
||||
public string ConfigFileKey
|
||||
{
|
||||
get
|
||||
{
|
||||
var key = this.Switch;
|
||||
if (key.StartsWith("--"))
|
||||
key = key.Substring(2);
|
||||
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ElectronNET.CLI.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for commands to implement.
|
||||
/// </summary>
|
||||
public interface ICommand
|
||||
{
|
||||
Task<bool> ExecuteAsync();
|
||||
}
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace ElectronNET.CLI.Commands
|
||||
{
|
||||
public class InitCommand : ICommand
|
||||
{
|
||||
public const string COMMAND_NAME = "init";
|
||||
public const string COMMAND_DESCRIPTION = "Creates the needed Electron.NET config for your Electron Application.";
|
||||
public const string COMMAND_ARGUMENTS = "<Path> from ASP.NET Core Project.";
|
||||
public static IList<CommandOption> CommandOptions { get; set; } = new List<CommandOption>();
|
||||
|
||||
private const string ConfigName = "electron.manifest.json";
|
||||
|
||||
private string[] _args;
|
||||
|
||||
public InitCommand(string[] args)
|
||||
{
|
||||
_args = args;
|
||||
}
|
||||
|
||||
public Task<bool> ExecuteAsync()
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
string aspCoreProjectPath = "";
|
||||
|
||||
if (_args.Length > 0)
|
||||
{
|
||||
if (Directory.Exists(_args[0]))
|
||||
{
|
||||
aspCoreProjectPath = _args[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
aspCoreProjectPath = Directory.GetCurrentDirectory();
|
||||
}
|
||||
|
||||
var currentDirectory = aspCoreProjectPath;
|
||||
|
||||
Console.WriteLine("Adding our config file to your project...");
|
||||
|
||||
var targetFilePath = Path.Combine(currentDirectory, ConfigName);
|
||||
|
||||
if (File.Exists(targetFilePath))
|
||||
{
|
||||
Console.WriteLine("Config file already in your project.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deploy config file
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(currentDirectory, ConfigName);
|
||||
|
||||
// search .csproj
|
||||
Console.WriteLine($"Search your .csproj to add the needed {ConfigName}...");
|
||||
var projectFile = Directory.EnumerateFiles(currentDirectory, "*.csproj", SearchOption.TopDirectoryOnly).FirstOrDefault();
|
||||
|
||||
// update config file with the name of the csproj
|
||||
// ToDo: If the csproj name != application name, this will fail
|
||||
string text = File.ReadAllText(targetFilePath);
|
||||
text = text.Replace("{{executable}}", Path.GetFileNameWithoutExtension(projectFile));
|
||||
File.WriteAllText(targetFilePath, text);
|
||||
|
||||
Console.WriteLine($"Found your .csproj: {projectFile} - check for existing config or update it.");
|
||||
|
||||
if (!EditCsProj(projectFile)) return false;
|
||||
|
||||
// search launchSettings.json
|
||||
Console.WriteLine($"Search your .launchSettings to add our electron debug profile...");
|
||||
|
||||
EditLaunchSettings(currentDirectory);
|
||||
|
||||
Console.WriteLine($"Everything done - happy electronizing!");
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
private static void EditLaunchSettings(string currentDirectory)
|
||||
{
|
||||
// super stupid implementation, but because there is no nativ way to parse json
|
||||
// and cli extensions and other nuget packages are buggy
|
||||
// this is should solve the problem for 80% of the users
|
||||
// for the other 20% we might fail...
|
||||
var launchSettingFile = Path.Combine(currentDirectory, "Properties", "launchSettings.json");
|
||||
|
||||
if (File.Exists(launchSettingFile) == false)
|
||||
{
|
||||
Console.WriteLine("launchSettings.json not found - do nothing.");
|
||||
return;
|
||||
}
|
||||
|
||||
string launchSettingText = File.ReadAllText(launchSettingFile);
|
||||
|
||||
if (launchSettingText.Contains("electronize start") == false)
|
||||
{
|
||||
StringBuilder debugProfileBuilder = new StringBuilder();
|
||||
debugProfileBuilder.AppendLine("profiles\": {");
|
||||
debugProfileBuilder.AppendLine("\"Electron.NET App\": {");
|
||||
debugProfileBuilder.AppendLine("\"commandName\": \"Executable\",");
|
||||
debugProfileBuilder.AppendLine("\"executablePath\": \"C:\\\\Program Files\\\\dotnet\\\\dotnet.exe\",");
|
||||
debugProfileBuilder.AppendLine("\"commandLineArgs\": \"electronize start\"");
|
||||
debugProfileBuilder.AppendLine("},");
|
||||
|
||||
launchSettingText = launchSettingText.Replace("profiles\": {", debugProfileBuilder.ToString());
|
||||
File.WriteAllText(launchSettingFile, launchSettingText);
|
||||
|
||||
Console.WriteLine($"Debug profile added!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Debug profile already existing");
|
||||
}
|
||||
}
|
||||
|
||||
private static bool EditCsProj(string projectFile)
|
||||
{
|
||||
using (var stream = File.Open(projectFile, FileMode.OpenOrCreate, FileAccess.ReadWrite))
|
||||
{
|
||||
var xmlDocument = XDocument.Load(stream);
|
||||
|
||||
var projectElement = xmlDocument.Descendants("Project").FirstOrDefault();
|
||||
if (projectElement == null || projectElement.Attribute("Sdk")?.Value != "Microsoft.NET.Sdk.Web")
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"Project file is not a compatible type of 'Microsoft.NET.Sdk.Web'. Your project: {projectElement?.Attribute("Sdk")?.Value}");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xmlDocument.ToString().Contains($"Content Update=\"{ConfigName}\""))
|
||||
{
|
||||
Console.WriteLine($"{ConfigName} already in csproj.");
|
||||
return false;
|
||||
}
|
||||
|
||||
Console.WriteLine($"{ConfigName} will be added to csproj.");
|
||||
|
||||
string itemGroupXmlString = "<ItemGroup>" +
|
||||
"<Content Update=\"" + ConfigName + "\">" +
|
||||
"<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>" +
|
||||
"</Content>" +
|
||||
"</ItemGroup>";
|
||||
|
||||
var newItemGroupForConfig = XElement.Parse(itemGroupXmlString);
|
||||
xmlDocument.Root.Add(newItemGroupForConfig);
|
||||
|
||||
stream.SetLength(0);
|
||||
stream.Position = 0;
|
||||
|
||||
var xws = new XmlWriterSettings
|
||||
{
|
||||
OmitXmlDeclaration = true,
|
||||
Indent = true
|
||||
};
|
||||
using (XmlWriter xw = XmlWriter.Create(stream, xws))
|
||||
{
|
||||
xmlDocument.Save(xw);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Console.WriteLine($"{ConfigName} added in csproj!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
using ElectronNET.CLI.Commands.Actions;
|
||||
|
||||
namespace ElectronNET.CLI.Commands
|
||||
{
|
||||
public class StartElectronCommand : ICommand
|
||||
{
|
||||
public const string COMMAND_NAME = "start";
|
||||
public const string COMMAND_DESCRIPTION = "Start your ASP.NET Core Application with Electron, without package it as a single exe. Faster for development.";
|
||||
public const string COMMAND_ARGUMENTS = "<Path> from ASP.NET Core Project.";
|
||||
public static IList<CommandOption> CommandOptions { get; set; } = new List<CommandOption>();
|
||||
|
||||
private string[] _args;
|
||||
|
||||
public StartElectronCommand(string[] args)
|
||||
{
|
||||
_args = args;
|
||||
}
|
||||
|
||||
public Task<bool> ExecuteAsync()
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
Console.WriteLine("Start Electron Desktop Application...");
|
||||
|
||||
string aspCoreProjectPath = "";
|
||||
|
||||
if (_args.Length > 0)
|
||||
{
|
||||
if (Directory.Exists(_args[0]))
|
||||
{
|
||||
aspCoreProjectPath = _args[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
aspCoreProjectPath = Directory.GetCurrentDirectory();
|
||||
}
|
||||
|
||||
string tempPath = Path.Combine(aspCoreProjectPath, "obj", "Host");
|
||||
if (Directory.Exists(tempPath) == false)
|
||||
{
|
||||
Directory.CreateDirectory(tempPath);
|
||||
}
|
||||
|
||||
var platformInfo = GetTargetPlatformInformation.Do(String.Empty, String.Empty);
|
||||
|
||||
string tempBinPath = Path.Combine(tempPath, "bin");
|
||||
var resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} --output \"{tempBinPath}\"", aspCoreProjectPath);
|
||||
|
||||
if (resultCode != 0)
|
||||
{
|
||||
Console.WriteLine("Error occurred during dotnet publish: " + resultCode);
|
||||
return false;
|
||||
}
|
||||
|
||||
DeployEmbeddedElectronFiles.Do(tempPath);
|
||||
|
||||
var checkForNodeModulesDirPath = Path.Combine(tempPath, "node_modules");
|
||||
|
||||
if (Directory.Exists(checkForNodeModulesDirPath) == false)
|
||||
{
|
||||
Console.WriteLine("node_modules missing in: " + checkForNodeModulesDirPath);
|
||||
|
||||
Console.WriteLine("Start npm install...");
|
||||
ProcessHelper.CmdExecute("npm install", tempPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Skip npm install, because node_modules directory exists in: " + checkForNodeModulesDirPath);
|
||||
}
|
||||
|
||||
string path = Path.Combine(tempPath, "node_modules", ".bin");
|
||||
|
||||
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
if (isWindows)
|
||||
{
|
||||
Console.WriteLine("Invoke electron.cmd - in dir: " + path);
|
||||
ProcessHelper.CmdExecute(@"electron.cmd ""..\..\main.js""", path);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Invoke electron - in dir: " + path);
|
||||
ProcessHelper.CmdExecute(@"./electron ""../../main.js""", path);
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ElectronNET.CLI.Commands
|
||||
{
|
||||
public class VersionCommand : ICommand
|
||||
{
|
||||
public const string COMMAND_NAME = "version";
|
||||
public const string COMMAND_DESCRIPTION = "Displays the ElectronNET.CLI version";
|
||||
public const string COMMAND_ARGUMENTS = "";
|
||||
public static IList<CommandOption> CommandOptions { get; set; } = new List<CommandOption>();
|
||||
|
||||
public VersionCommand(string[] args)
|
||||
{
|
||||
}
|
||||
|
||||
public Task<bool> ExecuteAsync()
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
var runtimeVersion = typeof(VersionCommand)
|
||||
.GetTypeInfo()
|
||||
.Assembly
|
||||
.GetCustomAttribute<AssemblyFileVersionAttribute>();
|
||||
|
||||
Console.WriteLine($"ElectronNET.CLI Version: " + runtimeVersion.Version);
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<AssemblyName>electronize</AssemblyName>
|
||||
|
||||
<PackageType>DotnetCliTool</PackageType>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageOutputPath>..\artifacts</PackageOutputPath>
|
||||
<PackageId>ElectronNET.CLI</PackageId>
|
||||
<Version>1.0.0.0</Version>
|
||||
<Authors>Gregor Biswanger, Robert Muehsig</Authors>
|
||||
<Product>Electron.NET</Product>
|
||||
<Company />
|
||||
<Description>Building cross platform electron based desktop apps with .NET Core and ASP.NET NET Core.
|
||||
This package contains the dotnet tooling to electronize your application.</Description>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/ElectronNET/Electron.NET/</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/ElectronNET/Electron.NET/</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<PackageTags>electron aspnetcore</PackageTags>
|
||||
<PackageReleaseNotes>Changelog: https://github.com/ElectronNET/Electron.NET/blob/master/Changelog.md</PackageReleaseNotes>
|
||||
<PackageIconUrl>https://raw.githubusercontent.com/ElectronNET/Electron.NET/master/assets/images/electron.net-logo-square.png</PackageIconUrl>
|
||||
<PackAsTool>true</PackAsTool>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="ElectronHost\package-lock.json" />
|
||||
<None Remove="ElectronHost\package.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile></DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DocumentationFile></DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\electron.manifest.json" Link="ElectronHost\electron.manifest.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\package-lock.json" Link="ElectronHost\package-lock.json" />
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\package.json" Link="ElectronHost\package.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\main.js" Link="ElectronHost\main.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\ipc.js" Link="ElectronHost\api\ipc.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\app.js" Link="ElectronHost\api\app.js" />
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\browserWindows.js" Link="ElectronHost\api\browserWindows.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\dialog.js" Link="ElectronHost\api\dialog.js" />
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\menu.js" Link="ElectronHost\api\menu.js" />
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\notification.js" Link="ElectronHost\api\notification.js" />
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\tray.js" Link="ElectronHost\api\tray.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\globalShortcut.js" Link="ElectronHost\api\globalShortcut.js" />
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\screen.js" Link="ElectronHost\api\screen.js" />
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\shell.js" Link="ElectronHost\api\shell.js" />
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\webContents.js" Link="ElectronHost\api\webContents.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\api\clipboard.js" Link="ElectronHost\api\clipboard.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
|
||||
<Exec Command="$(ProjectDir)devCleanup.cmd" IgnoreExitCode="true" />
|
||||
</Target>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' != 'Windows_NT'">
|
||||
<Exec Command="$(ProjectDir)devCleanup.sh" IgnoreExitCode="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ElectronNET.CLI
|
||||
{
|
||||
public static class EmbeddedFileHelper
|
||||
{
|
||||
private const string ResourcePath = "ElectronNET.CLI.{0}";
|
||||
|
||||
private static Stream GetTestResourceFileStream(string folderAndFileInProjectPath)
|
||||
{
|
||||
var asm = Assembly.GetExecutingAssembly();
|
||||
var resource = string.Format(ResourcePath, folderAndFileInProjectPath);
|
||||
|
||||
return asm.GetManifestResourceStream(resource);
|
||||
}
|
||||
|
||||
public static void DeployEmbeddedFile(string targetPath, string file, string namespacePath = "")
|
||||
{
|
||||
using (var fileStream = File.Create(Path.Combine(targetPath, file)))
|
||||
{
|
||||
var streamFromEmbeddedFile = GetTestResourceFileStream("ElectronHost." + namespacePath + file);
|
||||
if (streamFromEmbeddedFile == null)
|
||||
{
|
||||
Console.WriteLine("Error: Couldn't find embedded file: " + file);
|
||||
}
|
||||
|
||||
streamFromEmbeddedFile.CopyTo(fileStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace ElectronNET.CLI
|
||||
{
|
||||
public class ProcessHelper
|
||||
{
|
||||
public static int CmdExecute(string command, string workingDirectoryPath, bool output = true, bool waitForExit = true)
|
||||
{
|
||||
using (Process cmd = new Process())
|
||||
{
|
||||
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
|
||||
if (isWindows)
|
||||
{
|
||||
cmd.StartInfo.FileName = "cmd.exe";
|
||||
}
|
||||
else
|
||||
{
|
||||
// works for OSX and Linux (at least on Ubuntu)
|
||||
cmd.StartInfo.FileName = "bash";
|
||||
}
|
||||
|
||||
cmd.StartInfo.RedirectStandardInput = true;
|
||||
cmd.StartInfo.RedirectStandardOutput = true;
|
||||
cmd.StartInfo.RedirectStandardError = true;
|
||||
cmd.StartInfo.CreateNoWindow = true;
|
||||
cmd.StartInfo.UseShellExecute = false;
|
||||
cmd.StartInfo.WorkingDirectory = workingDirectoryPath;
|
||||
|
||||
int returnCode = 0;
|
||||
|
||||
if (output)
|
||||
{
|
||||
cmd.OutputDataReceived += (s, e) =>
|
||||
{
|
||||
// (sometimes error messages are only visbile here)
|
||||
// poor mans solution, we just seek for the term 'error'
|
||||
|
||||
// we can't just use cmd.ExitCode, because
|
||||
// we delegate it to cmd.exe, which runs fine
|
||||
// but we can catch any error here and return
|
||||
// 1 if something fails
|
||||
if (e != null && string.IsNullOrWhiteSpace(e.Data) == false)
|
||||
{
|
||||
if (e.Data.ToLowerInvariant().Contains("error"))
|
||||
{
|
||||
returnCode = 1;
|
||||
}
|
||||
|
||||
Console.WriteLine(e.Data);
|
||||
}
|
||||
|
||||
};
|
||||
cmd.ErrorDataReceived += (s, e) =>
|
||||
{
|
||||
// poor mans solution, we just seek for the term 'error'
|
||||
|
||||
// we can't just use cmd.ExitCode, because
|
||||
// we delegate it to cmd.exe, which runs fine
|
||||
// but we can catch any error here and return
|
||||
// 1 if something fails
|
||||
if (e != null && string.IsNullOrWhiteSpace(e.Data) == false)
|
||||
{
|
||||
if (e.Data.ToLowerInvariant().Contains("error"))
|
||||
{
|
||||
returnCode = 1;
|
||||
}
|
||||
|
||||
Console.WriteLine(e.Data);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
cmd.Start();
|
||||
cmd.BeginOutputReadLine();
|
||||
cmd.BeginErrorReadLine();
|
||||
|
||||
cmd.StandardInput.WriteLine(command);
|
||||
cmd.StandardInput.Flush();
|
||||
cmd.StandardInput.Close();
|
||||
|
||||
if (waitForExit)
|
||||
{
|
||||
cmd.WaitForExit();
|
||||
}
|
||||
|
||||
return returnCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,190 +0,0 @@
|
||||
using ElectronNET.CLI.Commands;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace ElectronNET.CLI
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
if (args.Length == 0)
|
||||
{
|
||||
PrintUsageHeader();
|
||||
PrintUsage();
|
||||
Environment.Exit(-1);
|
||||
}
|
||||
|
||||
ICommand command = null;
|
||||
|
||||
switch (args[0])
|
||||
{
|
||||
case StartElectronCommand.COMMAND_NAME:
|
||||
command = new StartElectronCommand(args.Skip(1).ToArray());
|
||||
break;
|
||||
case BuildCommand.COMMAND_NAME:
|
||||
command = new BuildCommand(args.Skip(1).ToArray());
|
||||
break;
|
||||
case InitCommand.COMMAND_NAME:
|
||||
command = new InitCommand(args.Skip(1).ToArray());
|
||||
break;
|
||||
case VersionCommand.COMMAND_NAME:
|
||||
command = new VersionCommand(args.Skip(1).ToArray());
|
||||
break;
|
||||
case "--help":
|
||||
case "--h":
|
||||
case "help":
|
||||
PrintUsageHeader();
|
||||
|
||||
if (args.Length > 1)
|
||||
PrintUsage(args[1]);
|
||||
else
|
||||
PrintUsage();
|
||||
break;
|
||||
default:
|
||||
Console.Error.WriteLine($"Unknown command {args[0]}");
|
||||
PrintUsage();
|
||||
Environment.Exit(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (command != null)
|
||||
{
|
||||
var success = command.ExecuteAsync().Result;
|
||||
if (!success)
|
||||
{
|
||||
Environment.Exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void PrintUsageHeader()
|
||||
{
|
||||
var sb = new StringBuilder("Electron.NET Tools");
|
||||
var version = Version;
|
||||
if (!string.IsNullOrEmpty(version))
|
||||
{
|
||||
sb.Append($" ({version})");
|
||||
}
|
||||
Console.WriteLine(sb.ToString());
|
||||
Console.WriteLine("Project Home: https://github.com/ElectronNET/Electron.NET");
|
||||
Console.WriteLine("\t");
|
||||
}
|
||||
|
||||
private static void PrintUsage()
|
||||
{
|
||||
const int NAME_WIDTH = 23;
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine("Commands to start the Electron Application:");
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine($"\t{StartElectronCommand.COMMAND_NAME.PadRight(NAME_WIDTH)} {StartElectronCommand.COMMAND_DESCRIPTION}");
|
||||
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine("Commands to build the Electron Application:");
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine($"\t{BuildCommand.COMMAND_NAME.PadRight(NAME_WIDTH)} {BuildCommand.COMMAND_DESCRIPTION}");
|
||||
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine("Commands to init the Electron Application:");
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine($"\t{InitCommand.COMMAND_NAME.PadRight(NAME_WIDTH)} {InitCommand.COMMAND_DESCRIPTION}");
|
||||
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine("Commands to see the current ElectronNET version number:");
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine($"\t{VersionCommand.COMMAND_NAME.PadRight(NAME_WIDTH)} {VersionCommand.COMMAND_DESCRIPTION}");
|
||||
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine("\t");
|
||||
Console.WriteLine("To get help on individual commands execute:");
|
||||
Console.WriteLine("\tdotnet electronize help <command>");
|
||||
}
|
||||
|
||||
private static void PrintUsage(string command)
|
||||
{
|
||||
switch (command)
|
||||
{
|
||||
case StartElectronCommand.COMMAND_NAME:
|
||||
PrintUsage(StartElectronCommand.COMMAND_NAME, StartElectronCommand.COMMAND_DESCRIPTION, StartElectronCommand.CommandOptions, StartElectronCommand.COMMAND_ARGUMENTS);
|
||||
break;
|
||||
case BuildCommand.COMMAND_NAME:
|
||||
PrintUsage(BuildCommand.COMMAND_NAME, BuildCommand.COMMAND_DESCRIPTION, BuildCommand.CommandOptions, BuildCommand.COMMAND_ARGUMENTS);
|
||||
break;
|
||||
case InitCommand.COMMAND_NAME:
|
||||
PrintUsage(InitCommand.COMMAND_NAME, InitCommand.COMMAND_DESCRIPTION, InitCommand.CommandOptions, InitCommand.COMMAND_ARGUMENTS);
|
||||
break;
|
||||
case VersionCommand.COMMAND_NAME:
|
||||
PrintUsage(VersionCommand.COMMAND_NAME, VersionCommand.COMMAND_DESCRIPTION, VersionCommand.CommandOptions, VersionCommand.COMMAND_ARGUMENTS);
|
||||
break;
|
||||
default:
|
||||
Console.Error.WriteLine($"Unknown command {command}");
|
||||
PrintUsage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void PrintUsage(string command, string description, IList<CommandOption> options, string arguments)
|
||||
{
|
||||
const int INDENT = 3;
|
||||
|
||||
Console.WriteLine($"{command}: ");
|
||||
Console.WriteLine($"{new string(' ', INDENT)}{description}");
|
||||
Console.WriteLine("\t");
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(arguments))
|
||||
{
|
||||
Console.WriteLine($"{new string(' ', INDENT)}dotnet electronize {command} [arguments] [options]");
|
||||
Console.WriteLine($"{new string(' ', INDENT)}Arguments:");
|
||||
Console.WriteLine($"{new string(' ', INDENT * 2)}{arguments}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"{new string(' ', INDENT)}dotnet electronize {command} [options]");
|
||||
}
|
||||
|
||||
const int SWITCH_COLUMN_WIDTH = 40;
|
||||
|
||||
Console.WriteLine($"{new string(' ', INDENT)}Options:");
|
||||
foreach (var option in options)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (option.ShortSwitch != null)
|
||||
{
|
||||
stringBuilder.Append($"{option.ShortSwitch.PadRight(6)} | ");
|
||||
}
|
||||
|
||||
stringBuilder.Append($"{option.Switch}");
|
||||
if (stringBuilder.Length < SWITCH_COLUMN_WIDTH)
|
||||
{
|
||||
stringBuilder.Append(new string(' ', SWITCH_COLUMN_WIDTH - stringBuilder.Length));
|
||||
}
|
||||
|
||||
stringBuilder.Append(option.Description);
|
||||
|
||||
|
||||
Console.WriteLine($"{new string(' ', INDENT * 2)}{stringBuilder.ToString()}");
|
||||
}
|
||||
}
|
||||
|
||||
private static string Version
|
||||
{
|
||||
get
|
||||
{
|
||||
AssemblyInformationalVersionAttribute attribute = null;
|
||||
try
|
||||
{
|
||||
attribute = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
}
|
||||
catch (AmbiguousMatchException)
|
||||
{
|
||||
// Catch exception and continue if multiple attributes are found.
|
||||
}
|
||||
return attribute?.InformationalVersion;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"profiles": {
|
||||
"ElectronNET.CLI": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "build \"C:\\Users\\Gregor\\Documents\\Visual Studio 2017\\Projects\\ElectronNET\\ElectronNET.WebApp\""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ElectronNET.CLI
|
||||
{
|
||||
public class SimpleCommandLineParser
|
||||
{
|
||||
public SimpleCommandLineParser()
|
||||
{
|
||||
Arguments = new Dictionary<string, string[]>();
|
||||
}
|
||||
public IDictionary<string, string[]> Arguments { get; private set; }
|
||||
public void Parse(string[] args)
|
||||
{
|
||||
var currentName = "";
|
||||
var values = new List<string>();
|
||||
foreach (var arg in args)
|
||||
{
|
||||
if (arg.StartsWith("/"))
|
||||
{
|
||||
if (currentName != "")
|
||||
Arguments[currentName] = values.ToArray();
|
||||
values.Clear();
|
||||
currentName = arg.Substring(1);
|
||||
}
|
||||
else if (currentName == "")
|
||||
Arguments[arg] = new string[0];
|
||||
else
|
||||
values.Add(arg);
|
||||
}
|
||||
if (currentName != "")
|
||||
Arguments[currentName] = values.ToArray();
|
||||
}
|
||||
public bool Contains(string name)
|
||||
{
|
||||
return Arguments.ContainsKey(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
rd /s /q %userprofile%\.nuget\packages\.tools\electronnet.cli
|
||||
rd /s /q %userprofile%\.nuget\packages\electronnet.cli
|
||||
del ..\artifacts\ElectronNET.CLI.1.0.0.nupkg
|
||||
@@ -1 +0,0 @@
|
||||
rm -rf ~/.nuget/packages/electronnet.cli
|
||||
@@ -1,256 +0,0 @@
|
||||
"use strict";
|
||||
var isQuitWindowAllClosed = true;
|
||||
module.exports = function (socket, app) {
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin' &&
|
||||
isQuitWindowAllClosed) {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
socket.on('quit-app-window-all-closed-event', function (quit) {
|
||||
isQuitWindowAllClosed = quit;
|
||||
});
|
||||
socket.on('register-app-window-all-closed-event', function (id) {
|
||||
app.on('window-all-closed', function () {
|
||||
socket.emit('app-window-all-closed' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-app-before-quit-event', function (id) {
|
||||
app.on('before-quit', function (event) {
|
||||
event.preventDefault();
|
||||
socket.emit('app-before-quit' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-app-will-quit-event', function (id) {
|
||||
app.on('will-quit', function (event) {
|
||||
event.preventDefault();
|
||||
socket.emit('app-will-quit' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-app-browser-window-blur-event', function (id) {
|
||||
app.on('browser-window-blur', function () {
|
||||
socket.emit('app-browser-window-blur' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-app-browser-window-focus-event', function (id) {
|
||||
app.on('browser-window-focus', function () {
|
||||
socket.emit('app-browser-window-focus' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-app-browser-window-created-event', function (id) {
|
||||
app.on('browser-window-created', function () {
|
||||
socket.emit('app-browser-window-created' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-app-web-contents-created-event', function (id) {
|
||||
app.on('web-contents-created', function () {
|
||||
socket.emit('app-web-contents-created' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-app-accessibility-support-changed-event', function (id) {
|
||||
app.on('accessibility-support-changed', function (event, accessibilitySupportEnabled) {
|
||||
socket.emit('app-accessibility-support-changed' + id, accessibilitySupportEnabled);
|
||||
});
|
||||
});
|
||||
socket.on('appQuit', function () {
|
||||
app.quit();
|
||||
});
|
||||
socket.on('appExit', function (exitCode) {
|
||||
if (exitCode === void 0) { exitCode = 0; }
|
||||
app.exit(exitCode);
|
||||
});
|
||||
socket.on('appRelaunch', function (options) {
|
||||
app.relaunch(options);
|
||||
});
|
||||
socket.on('appFocus', function () {
|
||||
app.focus();
|
||||
});
|
||||
socket.on('appHide', function () {
|
||||
app.hide();
|
||||
});
|
||||
socket.on('appShow', function () {
|
||||
app.show();
|
||||
});
|
||||
socket.on('appGetAppPath', function () {
|
||||
var path = app.getAppPath();
|
||||
socket.emit('appGetAppPathCompleted', path);
|
||||
});
|
||||
socket.on('appGetPath', function (name) {
|
||||
var path = app.getPath(name);
|
||||
socket.emit('appGetPathCompleted', path);
|
||||
});
|
||||
// const nativeImages = {};
|
||||
// function addNativeImage(nativeImage: Electron.NativeImage) {
|
||||
// if(Object.keys(nativeImages).length === 0) {
|
||||
// nativeImage['1'] = nativeImage;
|
||||
// } else {
|
||||
// let indexCount = Object.keys(nativeImages).length + 1;
|
||||
// nativeImage[indexCount] = nativeImage;
|
||||
// }
|
||||
// }
|
||||
socket.on('appGetFileIcon', function (path, options) {
|
||||
if (options) {
|
||||
app.getFileIcon(path, options, function (error, nativeImage) {
|
||||
socket.emit('appGetFileIconCompleted', [error, nativeImage]);
|
||||
});
|
||||
}
|
||||
else {
|
||||
app.getFileIcon(path, function (error, nativeImage) {
|
||||
socket.emit('appGetFileIconCompleted', [error, nativeImage]);
|
||||
});
|
||||
}
|
||||
});
|
||||
socket.on('appSetPath', function (name, path) {
|
||||
app.setPath(name, path);
|
||||
});
|
||||
socket.on('appGetVersion', function () {
|
||||
var version = app.getVersion();
|
||||
socket.emit('appGetVersionCompleted', version);
|
||||
});
|
||||
socket.on('appGetName', function () {
|
||||
var name = app.getName();
|
||||
socket.emit('appGetNameCompleted', name);
|
||||
});
|
||||
socket.on('appSetName', function (name) {
|
||||
app.setName(name);
|
||||
});
|
||||
socket.on('appGetLocale', function () {
|
||||
var locale = app.getLocale();
|
||||
socket.emit('appGetLocaleCompleted', locale);
|
||||
});
|
||||
socket.on('appAddRecentDocument', function (path) {
|
||||
app.addRecentDocument(path);
|
||||
});
|
||||
socket.on('appClearRecentDocuments', function () {
|
||||
app.clearRecentDocuments();
|
||||
});
|
||||
socket.on('appSetAsDefaultProtocolClient', function (protocol, path, args) {
|
||||
var success = app.setAsDefaultProtocolClient(protocol, path, args);
|
||||
socket.emit('appSetAsDefaultProtocolClientCompleted', success);
|
||||
});
|
||||
socket.on('appRemoveAsDefaultProtocolClient', function (protocol, path, args) {
|
||||
var success = app.removeAsDefaultProtocolClient(protocol, path, args);
|
||||
socket.emit('appRemoveAsDefaultProtocolClientCompleted', success);
|
||||
});
|
||||
socket.on('appIsDefaultProtocolClient', function (protocol, path, args) {
|
||||
var success = app.isDefaultProtocolClient(protocol, path, args);
|
||||
socket.emit('appIsDefaultProtocolClientCompleted', success);
|
||||
});
|
||||
socket.on('appSetUserTasks', function (tasks) {
|
||||
var success = app.setUserTasks(tasks);
|
||||
socket.emit('appSetUserTasksCompleted', success);
|
||||
});
|
||||
socket.on('appGetJumpListSettings', function () {
|
||||
var jumpListSettings = app.getJumpListSettings();
|
||||
socket.emit('appGetJumpListSettingsCompleted', jumpListSettings);
|
||||
});
|
||||
socket.on('appSetJumpList', function (categories) {
|
||||
app.setJumpList(categories);
|
||||
});
|
||||
socket.on('appRequestSingleInstanceLock', function () {
|
||||
app.on('second-instance', function (args, workingDirectory) {
|
||||
socket.emit('secondInstance', [args, workingDirectory]);
|
||||
});
|
||||
var success = app.requestSingleInstanceLock();
|
||||
socket.emit('appRequestSingleInstanceLockCompleted', success);
|
||||
});
|
||||
socket.on('appReleaseSingleInstanceLock', function () {
|
||||
app.releaseSingleInstanceLock();
|
||||
});
|
||||
socket.on('appSetUserActivity', function (type, userInfo, webpageURL) {
|
||||
app.setUserActivity(type, userInfo, webpageURL);
|
||||
});
|
||||
socket.on('appGetCurrentActivityType', function () {
|
||||
var activityType = app.getCurrentActivityType();
|
||||
socket.emit('appGetCurrentActivityTypeCompleted', activityType);
|
||||
});
|
||||
socket.on('appSetAppUserModelId', function (id) {
|
||||
app.setAppUserModelId(id);
|
||||
});
|
||||
socket.on('appImportCertificate', function (options) {
|
||||
app.importCertificate(options, function (result) {
|
||||
socket.emit('appImportCertificateCompleted', result);
|
||||
});
|
||||
});
|
||||
socket.on('appGetAppMetrics', function () {
|
||||
var processMetrics = app.getAppMetrics();
|
||||
socket.emit('appGetAppMetricsCompleted', processMetrics);
|
||||
});
|
||||
socket.on('appGetGpuFeatureStatus', function () {
|
||||
var gpuFeatureStatus = app.getGPUFeatureStatus();
|
||||
socket.emit('appGetGpuFeatureStatusCompleted', gpuFeatureStatus);
|
||||
});
|
||||
socket.on('appSetBadgeCount', function (count) {
|
||||
var success = app.setBadgeCount(count);
|
||||
socket.emit('appSetBadgeCountCompleted', success);
|
||||
});
|
||||
socket.on('appGetBadgeCount', function () {
|
||||
var count = app.getBadgeCount();
|
||||
socket.emit('appGetBadgeCountCompleted', count);
|
||||
});
|
||||
socket.on('appIsUnityRunning', function () {
|
||||
var isUnityRunning = app.isUnityRunning();
|
||||
socket.emit('appIsUnityRunningCompleted', isUnityRunning);
|
||||
});
|
||||
socket.on('appGetLoginItemSettings', function (options) {
|
||||
var loginItemSettings = app.getLoginItemSettings(options);
|
||||
socket.emit('appGetLoginItemSettingsCompleted', loginItemSettings);
|
||||
});
|
||||
socket.on('appSetLoginItemSettings', function (settings) {
|
||||
app.setLoginItemSettings(settings);
|
||||
});
|
||||
socket.on('appIsAccessibilitySupportEnabled', function () {
|
||||
var isAccessibilitySupportEnabled = app.isAccessibilitySupportEnabled();
|
||||
socket.emit('appIsAccessibilitySupportEnabledCompleted', isAccessibilitySupportEnabled);
|
||||
});
|
||||
socket.on('appSetAboutPanelOptions', function (options) {
|
||||
app.setAboutPanelOptions(options);
|
||||
});
|
||||
socket.on('appCommandLineAppendSwitch', function (theSwitch, value) {
|
||||
app.commandLine.appendSwitch(theSwitch, value);
|
||||
});
|
||||
socket.on('appCommandLineAppendArgument', function (value) {
|
||||
app.commandLine.appendArgument(value);
|
||||
});
|
||||
socket.on('appEnableMixedSandbox', function () {
|
||||
app.enableMixedSandbox();
|
||||
});
|
||||
socket.on('appDockBounce', function (type) {
|
||||
var id = app.dock.bounce(type);
|
||||
socket.emit('appDockBounceCompleted', id);
|
||||
});
|
||||
socket.on('appDockCancelBounce', function (id) {
|
||||
app.dock.cancelBounce(id);
|
||||
});
|
||||
socket.on('appDockDownloadFinished', function (filePath) {
|
||||
app.dock.downloadFinished(filePath);
|
||||
});
|
||||
socket.on('appDockSetBadge', function (text) {
|
||||
app.dock.setBadge(text);
|
||||
});
|
||||
socket.on('appDockGetBadge', function () {
|
||||
var text = app.dock.getBadge();
|
||||
socket.emit('appDockGetBadgeCompleted', text);
|
||||
});
|
||||
socket.on('appDockHide', function () {
|
||||
app.dock.hide();
|
||||
});
|
||||
socket.on('appDockShow', function () {
|
||||
app.dock.show();
|
||||
});
|
||||
socket.on('appDockIsVisible', function () {
|
||||
var isVisible = app.dock.isVisible();
|
||||
socket.emit('appDockIsVisibleCompleted', isVisible);
|
||||
});
|
||||
// TODO: Menü Lösung muss noch implementiert werden
|
||||
socket.on('appDockSetMenu', function (menu) {
|
||||
app.dock.setMenu(menu);
|
||||
});
|
||||
socket.on('appDockSetIcon', function (image) {
|
||||
app.dock.setIcon(image);
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=app.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,320 +0,0 @@
|
||||
import { nativeImage as NativeImage } from 'electron';
|
||||
let isQuitWindowAllClosed = true;
|
||||
|
||||
export = (socket: SocketIO.Socket, app: Electron.App) => {
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', () => {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin' &&
|
||||
isQuitWindowAllClosed) {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('quit-app-window-all-closed-event', (quit) => {
|
||||
isQuitWindowAllClosed = quit;
|
||||
});
|
||||
|
||||
socket.on('register-app-window-all-closed-event', (id) => {
|
||||
app.on('window-all-closed', () => {
|
||||
socket.emit('app-window-all-closed' + id);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-app-before-quit-event', (id) => {
|
||||
app.on('before-quit', (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
socket.emit('app-before-quit' + id);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-app-will-quit-event', (id) => {
|
||||
app.on('will-quit', (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
socket.emit('app-will-quit' + id);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-app-browser-window-blur-event', (id) => {
|
||||
app.on('browser-window-blur', () => {
|
||||
socket.emit('app-browser-window-blur' + id);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-app-browser-window-focus-event', (id) => {
|
||||
app.on('browser-window-focus', () => {
|
||||
socket.emit('app-browser-window-focus' + id);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-app-browser-window-created-event', (id) => {
|
||||
app.on('browser-window-created', () => {
|
||||
socket.emit('app-browser-window-created' + id);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-app-web-contents-created-event', (id) => {
|
||||
app.on('web-contents-created', () => {
|
||||
socket.emit('app-web-contents-created' + id);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-app-accessibility-support-changed-event', (id) => {
|
||||
app.on('accessibility-support-changed', (event, accessibilitySupportEnabled) => {
|
||||
socket.emit('app-accessibility-support-changed' + id, accessibilitySupportEnabled);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('appQuit', () => {
|
||||
app.quit();
|
||||
});
|
||||
|
||||
socket.on('appExit', (exitCode = 0) => {
|
||||
app.exit(exitCode);
|
||||
});
|
||||
|
||||
socket.on('appRelaunch', (options) => {
|
||||
app.relaunch(options);
|
||||
});
|
||||
|
||||
socket.on('appFocus', () => {
|
||||
app.focus();
|
||||
});
|
||||
|
||||
socket.on('appHide', () => {
|
||||
app.hide();
|
||||
});
|
||||
|
||||
socket.on('appShow', () => {
|
||||
app.show();
|
||||
});
|
||||
|
||||
socket.on('appGetAppPath', () => {
|
||||
const path = app.getAppPath();
|
||||
socket.emit('appGetAppPathCompleted', path);
|
||||
});
|
||||
|
||||
socket.on('appGetPath', (name) => {
|
||||
const path = app.getPath(name);
|
||||
socket.emit('appGetPathCompleted', path);
|
||||
});
|
||||
|
||||
// const nativeImages = {};
|
||||
|
||||
// function addNativeImage(nativeImage: Electron.NativeImage) {
|
||||
|
||||
// if(Object.keys(nativeImages).length === 0) {
|
||||
// nativeImage['1'] = nativeImage;
|
||||
// } else {
|
||||
// let indexCount = Object.keys(nativeImages).length + 1;
|
||||
// nativeImage[indexCount] = nativeImage;
|
||||
// }
|
||||
// }
|
||||
|
||||
socket.on('appGetFileIcon', (path, options) => {
|
||||
if (options) {
|
||||
app.getFileIcon(path, options, (error, nativeImage) => {
|
||||
socket.emit('appGetFileIconCompleted', [error, nativeImage]);
|
||||
});
|
||||
} else {
|
||||
app.getFileIcon(path, (error, nativeImage) => {
|
||||
socket.emit('appGetFileIconCompleted', [error, nativeImage]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('appSetPath', (name, path) => {
|
||||
app.setPath(name, path);
|
||||
});
|
||||
|
||||
socket.on('appGetVersion', () => {
|
||||
const version = app.getVersion();
|
||||
socket.emit('appGetVersionCompleted', version);
|
||||
});
|
||||
|
||||
socket.on('appGetName', () => {
|
||||
const name = app.getName();
|
||||
socket.emit('appGetNameCompleted', name);
|
||||
});
|
||||
|
||||
socket.on('appSetName', (name) => {
|
||||
app.setName(name);
|
||||
});
|
||||
|
||||
socket.on('appGetLocale', () => {
|
||||
const locale = app.getLocale();
|
||||
socket.emit('appGetLocaleCompleted', locale);
|
||||
});
|
||||
|
||||
socket.on('appAddRecentDocument', (path) => {
|
||||
app.addRecentDocument(path);
|
||||
});
|
||||
|
||||
socket.on('appClearRecentDocuments', () => {
|
||||
app.clearRecentDocuments();
|
||||
});
|
||||
|
||||
socket.on('appSetAsDefaultProtocolClient', (protocol, path, args) => {
|
||||
const success = app.setAsDefaultProtocolClient(protocol, path, args);
|
||||
socket.emit('appSetAsDefaultProtocolClientCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('appRemoveAsDefaultProtocolClient', (protocol, path, args) => {
|
||||
const success = app.removeAsDefaultProtocolClient(protocol, path, args);
|
||||
socket.emit('appRemoveAsDefaultProtocolClientCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('appIsDefaultProtocolClient', (protocol, path, args) => {
|
||||
const success = app.isDefaultProtocolClient(protocol, path, args);
|
||||
socket.emit('appIsDefaultProtocolClientCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('appSetUserTasks', (tasks) => {
|
||||
const success = app.setUserTasks(tasks);
|
||||
socket.emit('appSetUserTasksCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('appGetJumpListSettings', () => {
|
||||
const jumpListSettings = app.getJumpListSettings();
|
||||
socket.emit('appGetJumpListSettingsCompleted', jumpListSettings);
|
||||
});
|
||||
|
||||
socket.on('appSetJumpList', (categories) => {
|
||||
app.setJumpList(categories);
|
||||
});
|
||||
|
||||
socket.on('appRequestSingleInstanceLock', () => {
|
||||
app.on('second-instance', (args, workingDirectory) => {
|
||||
socket.emit('secondInstance', [args, workingDirectory]);
|
||||
});
|
||||
|
||||
const success = app.requestSingleInstanceLock();
|
||||
socket.emit('appRequestSingleInstanceLockCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('appReleaseSingleInstanceLock', () => {
|
||||
app.releaseSingleInstanceLock();
|
||||
});
|
||||
|
||||
socket.on('appSetUserActivity', (type, userInfo, webpageURL) => {
|
||||
app.setUserActivity(type, userInfo, webpageURL);
|
||||
});
|
||||
|
||||
socket.on('appGetCurrentActivityType', () => {
|
||||
const activityType = app.getCurrentActivityType();
|
||||
socket.emit('appGetCurrentActivityTypeCompleted', activityType);
|
||||
});
|
||||
|
||||
socket.on('appSetAppUserModelId', (id) => {
|
||||
app.setAppUserModelId(id);
|
||||
});
|
||||
|
||||
socket.on('appImportCertificate', (options) => {
|
||||
app.importCertificate(options, (result) => {
|
||||
socket.emit('appImportCertificateCompleted', result);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('appGetAppMetrics', () => {
|
||||
const processMetrics = app.getAppMetrics();
|
||||
socket.emit('appGetAppMetricsCompleted', processMetrics);
|
||||
});
|
||||
|
||||
socket.on('appGetGpuFeatureStatus', () => {
|
||||
const gpuFeatureStatus = app.getGPUFeatureStatus();
|
||||
socket.emit('appGetGpuFeatureStatusCompleted', gpuFeatureStatus);
|
||||
});
|
||||
|
||||
socket.on('appSetBadgeCount', (count) => {
|
||||
const success = app.setBadgeCount(count);
|
||||
socket.emit('appSetBadgeCountCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('appGetBadgeCount', () => {
|
||||
const count = app.getBadgeCount();
|
||||
socket.emit('appGetBadgeCountCompleted', count);
|
||||
});
|
||||
|
||||
socket.on('appIsUnityRunning', () => {
|
||||
const isUnityRunning = app.isUnityRunning();
|
||||
socket.emit('appIsUnityRunningCompleted', isUnityRunning);
|
||||
});
|
||||
|
||||
socket.on('appGetLoginItemSettings', (options) => {
|
||||
const loginItemSettings = app.getLoginItemSettings(options);
|
||||
socket.emit('appGetLoginItemSettingsCompleted', loginItemSettings);
|
||||
});
|
||||
|
||||
socket.on('appSetLoginItemSettings', (settings) => {
|
||||
app.setLoginItemSettings(settings);
|
||||
});
|
||||
|
||||
socket.on('appIsAccessibilitySupportEnabled', () => {
|
||||
const isAccessibilitySupportEnabled = app.isAccessibilitySupportEnabled();
|
||||
socket.emit('appIsAccessibilitySupportEnabledCompleted', isAccessibilitySupportEnabled);
|
||||
});
|
||||
|
||||
socket.on('appSetAboutPanelOptions', (options) => {
|
||||
app.setAboutPanelOptions(options);
|
||||
});
|
||||
|
||||
socket.on('appCommandLineAppendSwitch', (theSwitch, value) => {
|
||||
app.commandLine.appendSwitch(theSwitch, value);
|
||||
});
|
||||
|
||||
socket.on('appCommandLineAppendArgument', (value) => {
|
||||
app.commandLine.appendArgument(value);
|
||||
});
|
||||
|
||||
socket.on('appEnableMixedSandbox', () => {
|
||||
app.enableMixedSandbox();
|
||||
});
|
||||
|
||||
socket.on('appDockBounce', (type) => {
|
||||
const id = app.dock.bounce(type);
|
||||
socket.emit('appDockBounceCompleted', id);
|
||||
});
|
||||
|
||||
socket.on('appDockCancelBounce', (id) => {
|
||||
app.dock.cancelBounce(id);
|
||||
});
|
||||
|
||||
socket.on('appDockDownloadFinished', (filePath) => {
|
||||
app.dock.downloadFinished(filePath);
|
||||
});
|
||||
|
||||
socket.on('appDockSetBadge', (text) => {
|
||||
app.dock.setBadge(text);
|
||||
});
|
||||
|
||||
socket.on('appDockGetBadge', () => {
|
||||
const text = app.dock.getBadge();
|
||||
socket.emit('appDockGetBadgeCompleted', text);
|
||||
});
|
||||
|
||||
socket.on('appDockHide', () => {
|
||||
app.dock.hide();
|
||||
});
|
||||
|
||||
socket.on('appDockShow', () => {
|
||||
app.dock.show();
|
||||
});
|
||||
|
||||
socket.on('appDockIsVisible', () => {
|
||||
const isVisible = app.dock.isVisible();
|
||||
socket.emit('appDockIsVisibleCompleted', isVisible);
|
||||
});
|
||||
|
||||
// TODO: Menü Lösung muss noch implementiert werden
|
||||
socket.on('appDockSetMenu', (menu) => {
|
||||
app.dock.setMenu(menu);
|
||||
});
|
||||
|
||||
socket.on('appDockSetIcon', (image) => {
|
||||
app.dock.setIcon(image);
|
||||
});
|
||||
};
|
||||
@@ -1,538 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
var path = require('path');
|
||||
var windows = [];
|
||||
var window, lastOptions;
|
||||
module.exports = function (socket, app) {
|
||||
socket.on('register-browserWindow-ready-to-show', function (id) {
|
||||
getWindowById(id).on('ready-to-show', function () {
|
||||
socket.emit('browserWindow-ready-to-show' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-page-title-updated', function (id) {
|
||||
getWindowById(id).on('page-title-updated', function (event, title) {
|
||||
socket.emit('browserWindow-page-title-updated' + id, title);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-close', function (id) {
|
||||
getWindowById(id).on('close', function () {
|
||||
socket.emit('browserWindow-close' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-closed', function (id) {
|
||||
getWindowById(id).on('closed', function () {
|
||||
socket.emit('browserWindow-closed' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-session-end', function (id) {
|
||||
getWindowById(id).on('session-end', function () {
|
||||
socket.emit('browserWindow-session-end' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-unresponsive', function (id) {
|
||||
getWindowById(id).on('unresponsive', function () {
|
||||
socket.emit('browserWindow-unresponsive' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-responsive', function (id) {
|
||||
getWindowById(id).on('responsive', function () {
|
||||
socket.emit('browserWindow-responsive' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-blur', function (id) {
|
||||
getWindowById(id).on('blur', function () {
|
||||
socket.emit('browserWindow-blur' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-focus', function (id) {
|
||||
getWindowById(id).on('focus', function () {
|
||||
socket.emit('browserWindow-focus' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-show', function (id) {
|
||||
getWindowById(id).on('show', function () {
|
||||
socket.emit('browserWindow-show' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-hide', function (id) {
|
||||
getWindowById(id).on('hide', function () {
|
||||
socket.emit('browserWindow-hide' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-maximize', function (id) {
|
||||
getWindowById(id).on('maximize', function () {
|
||||
socket.emit('browserWindow-maximize' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-unmaximize', function (id) {
|
||||
getWindowById(id).on('unmaximize', function () {
|
||||
socket.emit('browserWindow-unmaximize' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-minimize', function (id) {
|
||||
getWindowById(id).on('minimize', function () {
|
||||
socket.emit('browserWindow-minimize' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-restore', function (id) {
|
||||
getWindowById(id).on('restore', function () {
|
||||
socket.emit('browserWindow-restore' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-resize', function (id) {
|
||||
getWindowById(id).on('resize', function () {
|
||||
socket.emit('browserWindow-resize' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-move', function (id) {
|
||||
getWindowById(id).on('move', function () {
|
||||
socket.emit('browserWindow-move' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-moved', function (id) {
|
||||
getWindowById(id).on('moved', function () {
|
||||
socket.emit('browserWindow-moved' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-enter-full-screen', function (id) {
|
||||
getWindowById(id).on('enter-full-screen', function () {
|
||||
socket.emit('browserWindow-enter-full-screen' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-leave-full-screen', function (id) {
|
||||
getWindowById(id).on('leave-full-screen', function () {
|
||||
socket.emit('browserWindow-leave-full-screen' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-enter-html-full-screen', function (id) {
|
||||
getWindowById(id).on('enter-html-full-screen', function () {
|
||||
socket.emit('browserWindow-enter-html-full-screen' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-leave-html-full-screen', function (id) {
|
||||
getWindowById(id).on('leave-html-full-screen', function () {
|
||||
socket.emit('browserWindow-leave-html-full-screen' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-app-command', function (id) {
|
||||
getWindowById(id).on('app-command', function (event, command) {
|
||||
socket.emit('browserWindow-app-command' + id, command);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-scroll-touch-begin', function (id) {
|
||||
getWindowById(id).on('scroll-touch-begin', function () {
|
||||
socket.emit('browserWindow-scroll-touch-begin' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-scroll-touch-end', function (id) {
|
||||
getWindowById(id).on('scroll-touch-end', function () {
|
||||
socket.emit('browserWindow-scroll-touch-end' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-scroll-touch-edge', function (id) {
|
||||
getWindowById(id).on('scroll-touch-edge', function () {
|
||||
socket.emit('browserWindow-scroll-touch-edge' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-swipe', function (id) {
|
||||
getWindowById(id).on('swipe', function (event, direction) {
|
||||
socket.emit('browserWindow-swipe' + id, direction);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-sheet-begin', function (id) {
|
||||
getWindowById(id).on('sheet-begin', function () {
|
||||
socket.emit('browserWindow-sheet-begin' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-sheet-end', function (id) {
|
||||
getWindowById(id).on('sheet-end', function () {
|
||||
socket.emit('browserWindow-sheet-end' + id);
|
||||
});
|
||||
});
|
||||
socket.on('register-browserWindow-new-window-for-tab', function (id) {
|
||||
getWindowById(id).on('new-window-for-tab', function () {
|
||||
socket.emit('browserWindow-new-window-for-tab' + id);
|
||||
});
|
||||
});
|
||||
socket.on('createBrowserWindow', function (options, loadUrl) {
|
||||
window = new electron_1.BrowserWindow(options);
|
||||
lastOptions = options;
|
||||
window.on('closed', function (sender) {
|
||||
var _loop_1 = function () {
|
||||
windowItem = windows[index];
|
||||
try {
|
||||
windowItem.id;
|
||||
}
|
||||
catch (error) {
|
||||
if (error.message === 'Object has been destroyed') {
|
||||
windows.splice(index, 1);
|
||||
var ids_1 = [];
|
||||
windows.forEach(function (x) { return ids_1.push(x.id); });
|
||||
socket.emit('BrowserWindowClosed', ids_1);
|
||||
}
|
||||
}
|
||||
};
|
||||
var windowItem;
|
||||
for (var index = 0; index < windows.length; index++) {
|
||||
_loop_1();
|
||||
}
|
||||
});
|
||||
app.on('activate', function () {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (window === null && lastOptions) {
|
||||
window = new electron_1.BrowserWindow(lastOptions);
|
||||
}
|
||||
});
|
||||
if (loadUrl) {
|
||||
window.loadURL(loadUrl);
|
||||
}
|
||||
windows.push(window);
|
||||
socket.emit('BrowserWindowCreated', window.id);
|
||||
});
|
||||
socket.on('browserWindowDestroy', function (id) {
|
||||
getWindowById(id).destroy();
|
||||
});
|
||||
socket.on('browserWindowClose', function (id) {
|
||||
getWindowById(id).close();
|
||||
});
|
||||
socket.on('browserWindowFocus', function (id) {
|
||||
getWindowById(id).focus();
|
||||
});
|
||||
socket.on('browserWindowBlur', function (id) {
|
||||
getWindowById(id).blur();
|
||||
});
|
||||
socket.on('browserWindowIsFocused', function (id) {
|
||||
var isFocused = getWindowById(id).isFocused();
|
||||
socket.emit('browserWindow-isFocused-completed', isFocused);
|
||||
});
|
||||
socket.on('browserWindowIsDestroyed', function (id) {
|
||||
var isDestroyed = getWindowById(id).isDestroyed();
|
||||
socket.emit('browserWindow-isDestroyed-completed', isDestroyed);
|
||||
});
|
||||
socket.on('browserWindowShow', function (id) {
|
||||
getWindowById(id).show();
|
||||
});
|
||||
socket.on('browserWindowShowInactive', function (id) {
|
||||
getWindowById(id).showInactive();
|
||||
});
|
||||
socket.on('browserWindowHide', function (id) {
|
||||
getWindowById(id).hide();
|
||||
});
|
||||
socket.on('browserWindowIsVisible', function (id) {
|
||||
var isVisible = getWindowById(id).isVisible();
|
||||
socket.emit('browserWindow-isVisible-completed', isVisible);
|
||||
});
|
||||
socket.on('browserWindowIsModal', function (id) {
|
||||
var isModal = getWindowById(id).isModal();
|
||||
socket.emit('browserWindow-isModal-completed', isModal);
|
||||
});
|
||||
socket.on('browserWindowMaximize', function (id) {
|
||||
getWindowById(id).maximize();
|
||||
});
|
||||
socket.on('browserWindowUnmaximize', function (id) {
|
||||
getWindowById(id).unmaximize();
|
||||
});
|
||||
socket.on('browserWindowIsMaximized', function (id) {
|
||||
var isMaximized = getWindowById(id).isMaximized();
|
||||
socket.emit('browserWindow-isMaximized-completed', isMaximized);
|
||||
});
|
||||
socket.on('browserWindowMinimize', function (id) {
|
||||
getWindowById(id).minimize();
|
||||
});
|
||||
socket.on('browserWindowRestore', function (id) {
|
||||
getWindowById(id).restore();
|
||||
});
|
||||
socket.on('browserWindowIsMinimized', function (id) {
|
||||
var isMinimized = getWindowById(id).isMinimized();
|
||||
socket.emit('browserWindow-isMinimized-completed', isMinimized);
|
||||
});
|
||||
socket.on('browserWindowSetFullScreen', function (id, fullscreen) {
|
||||
getWindowById(id).setFullScreen(fullscreen);
|
||||
});
|
||||
socket.on('browserWindowIsFullScreen', function (id) {
|
||||
var isFullScreen = getWindowById(id).isFullScreen();
|
||||
socket.emit('browserWindow-isFullScreen-completed', isFullScreen);
|
||||
});
|
||||
socket.on('browserWindowSetAspectRatio', function (id, aspectRatio, extraSize) {
|
||||
getWindowById(id).setAspectRatio(aspectRatio, extraSize);
|
||||
});
|
||||
socket.on('browserWindowPreviewFile', function (id, path, displayname) {
|
||||
getWindowById(id).previewFile(path, displayname);
|
||||
});
|
||||
socket.on('browserWindowCloseFilePreview', function (id) {
|
||||
getWindowById(id).closeFilePreview();
|
||||
});
|
||||
socket.on('browserWindowSetBounds', function (id, bounds, animate) {
|
||||
getWindowById(id).setBounds(bounds, animate);
|
||||
});
|
||||
socket.on('browserWindowGetBounds', function (id) {
|
||||
var rectangle = getWindowById(id).getBounds();
|
||||
socket.emit('browserWindow-getBounds-completed', rectangle);
|
||||
});
|
||||
socket.on('browserWindowSetContentBounds', function (id, bounds, animate) {
|
||||
getWindowById(id).setContentBounds(bounds, animate);
|
||||
});
|
||||
socket.on('browserWindowGetContentBounds', function (id) {
|
||||
var rectangle = getWindowById(id).getContentBounds();
|
||||
socket.emit('browserWindow-getContentBounds-completed', rectangle);
|
||||
});
|
||||
socket.on('browserWindowSetSize', function (id, width, height, animate) {
|
||||
getWindowById(id).setSize(width, height, animate);
|
||||
});
|
||||
socket.on('browserWindowGetSize', function (id) {
|
||||
var size = getWindowById(id).getSize();
|
||||
socket.emit('browserWindow-getSize-completed', size);
|
||||
});
|
||||
socket.on('browserWindowSetContentSize', function (id, width, height, animate) {
|
||||
getWindowById(id).setContentSize(width, height, animate);
|
||||
});
|
||||
socket.on('browserWindowGetContentSize', function (id) {
|
||||
var size = getWindowById(id).getContentSize();
|
||||
socket.emit('browserWindow-getContentSize-completed', size);
|
||||
});
|
||||
socket.on('browserWindowSetMinimumSize', function (id, width, height) {
|
||||
getWindowById(id).setMinimumSize(width, height);
|
||||
});
|
||||
socket.on('browserWindowGetMinimumSize', function (id) {
|
||||
var size = getWindowById(id).getMinimumSize();
|
||||
socket.emit('browserWindow-getMinimumSize-completed', size);
|
||||
});
|
||||
socket.on('browserWindowSetMaximumSize', function (id, width, height) {
|
||||
getWindowById(id).setMaximumSize(width, height);
|
||||
});
|
||||
socket.on('browserWindowGetMaximumSize', function (id) {
|
||||
var size = getWindowById(id).getMaximumSize();
|
||||
socket.emit('browserWindow-getMaximumSize-completed', size);
|
||||
});
|
||||
socket.on('browserWindowSetResizable', function (id, resizable) {
|
||||
getWindowById(id).setResizable(resizable);
|
||||
});
|
||||
socket.on('browserWindowIsResizable', function (id) {
|
||||
var resizable = getWindowById(id).isResizable();
|
||||
socket.emit('browserWindow-isResizable-completed', resizable);
|
||||
});
|
||||
socket.on('browserWindowSetMovable', function (id, movable) {
|
||||
getWindowById(id).setMovable(movable);
|
||||
});
|
||||
socket.on('browserWindowIsMovable', function (id) {
|
||||
var movable = getWindowById(id).isMovable();
|
||||
socket.emit('browserWindow-isMovable-completed', movable);
|
||||
});
|
||||
socket.on('browserWindowSetMinimizable', function (id, minimizable) {
|
||||
getWindowById(id).setMinimizable(minimizable);
|
||||
});
|
||||
socket.on('browserWindowIsMinimizable', function (id) {
|
||||
var minimizable = getWindowById(id).isMinimizable();
|
||||
socket.emit('browserWindow-isMinimizable-completed', minimizable);
|
||||
});
|
||||
socket.on('browserWindowSetMaximizable', function (id, maximizable) {
|
||||
getWindowById(id).setMaximizable(maximizable);
|
||||
});
|
||||
socket.on('browserWindowIsMaximizable', function (id) {
|
||||
var maximizable = getWindowById(id).isMaximizable();
|
||||
socket.emit('browserWindow-isMaximizable-completed', maximizable);
|
||||
});
|
||||
socket.on('browserWindowSetFullScreenable', function (id, fullscreenable) {
|
||||
getWindowById(id).setFullScreenable(fullscreenable);
|
||||
});
|
||||
socket.on('browserWindowIsFullScreenable', function (id) {
|
||||
var fullscreenable = getWindowById(id).isFullScreenable();
|
||||
socket.emit('browserWindow-isFullScreenable-completed', fullscreenable);
|
||||
});
|
||||
socket.on('browserWindowSetClosable', function (id, closable) {
|
||||
getWindowById(id).setClosable(closable);
|
||||
});
|
||||
socket.on('browserWindowIsClosable', function (id) {
|
||||
var closable = getWindowById(id).isClosable();
|
||||
socket.emit('browserWindow-isClosable-completed', closable);
|
||||
});
|
||||
socket.on('browserWindowSetAlwaysOnTop', function (id, flag, level, relativeLevel) {
|
||||
getWindowById(id).setAlwaysOnTop(flag, level, relativeLevel);
|
||||
});
|
||||
socket.on('browserWindowIsAlwaysOnTop', function (id) {
|
||||
var isAlwaysOnTop = getWindowById(id).isAlwaysOnTop();
|
||||
socket.emit('browserWindow-isAlwaysOnTop-completed', isAlwaysOnTop);
|
||||
});
|
||||
socket.on('browserWindowCenter', function (id) {
|
||||
getWindowById(id).center();
|
||||
});
|
||||
socket.on('browserWindowSetPosition', function (id, x, y, animate) {
|
||||
getWindowById(id).setPosition(x, y, animate);
|
||||
});
|
||||
socket.on('browserWindowGetPosition', function (id) {
|
||||
var position = getWindowById(id).getPosition();
|
||||
socket.emit('browserWindow-getPosition-completed', position);
|
||||
});
|
||||
socket.on('browserWindowSetTitle', function (id, title) {
|
||||
getWindowById(id).setTitle(title);
|
||||
});
|
||||
socket.on('browserWindowGetTitle', function (id) {
|
||||
var title = getWindowById(id).getTitle();
|
||||
socket.emit('browserWindow-getTitle-completed', title);
|
||||
});
|
||||
socket.on('browserWindowSetTitle', function (id, title) {
|
||||
getWindowById(id).setTitle(title);
|
||||
});
|
||||
socket.on('browserWindowSetSheetOffset', function (id, offsetY, offsetX) {
|
||||
if (offsetX) {
|
||||
getWindowById(id).setSheetOffset(offsetY, offsetX);
|
||||
}
|
||||
else {
|
||||
getWindowById(id).setSheetOffset(offsetY);
|
||||
}
|
||||
});
|
||||
socket.on('browserWindowFlashFrame', function (id, flag) {
|
||||
getWindowById(id).flashFrame(flag);
|
||||
});
|
||||
socket.on('browserWindowSetSkipTaskbar', function (id, skip) {
|
||||
getWindowById(id).setSkipTaskbar(skip);
|
||||
});
|
||||
socket.on('browserWindowSetKiosk', function (id, flag) {
|
||||
getWindowById(id).setKiosk(flag);
|
||||
});
|
||||
socket.on('browserWindowIsKiosk', function (id) {
|
||||
var isKiosk = getWindowById(id).isKiosk();
|
||||
socket.emit('browserWindow-isKiosk-completed', isKiosk);
|
||||
});
|
||||
socket.on('browserWindowSetRepresentedFilename', function (id, filename) {
|
||||
getWindowById(id).setRepresentedFilename(filename);
|
||||
});
|
||||
socket.on('browserWindowGetRepresentedFilename', function (id) {
|
||||
var pathname = getWindowById(id).getRepresentedFilename();
|
||||
socket.emit('browserWindow-getRepresentedFilename-completed', pathname);
|
||||
});
|
||||
socket.on('browserWindowSetDocumentEdited', function (id, edited) {
|
||||
getWindowById(id).setDocumentEdited(edited);
|
||||
});
|
||||
socket.on('browserWindowIsDocumentEdited', function (id) {
|
||||
var edited = getWindowById(id).isDocumentEdited();
|
||||
socket.emit('browserWindow-isDocumentEdited-completed', edited);
|
||||
});
|
||||
socket.on('browserWindowFocusOnWebView', function (id) {
|
||||
getWindowById(id).focusOnWebView();
|
||||
});
|
||||
socket.on('browserWindowBlurWebView', function (id) {
|
||||
getWindowById(id).blurWebView();
|
||||
});
|
||||
socket.on('browserWindowLoadURL', function (id, url, options) {
|
||||
getWindowById(id).loadURL(url, options);
|
||||
});
|
||||
socket.on('browserWindowReload', function (id) {
|
||||
getWindowById(id).reload();
|
||||
});
|
||||
socket.on('browserWindowSetMenu', function (id, menuItems) {
|
||||
var menu = null;
|
||||
if (menuItems) {
|
||||
menu = electron_1.Menu.buildFromTemplate(menuItems);
|
||||
addMenuItemClickConnector(menu.items, function (id) {
|
||||
socket.emit("windowMenuItemClicked", id);
|
||||
});
|
||||
}
|
||||
getWindowById(id).setMenu(menu);
|
||||
});
|
||||
function addMenuItemClickConnector(menuItems, callback) {
|
||||
menuItems.forEach(function (item) {
|
||||
if (item.submenu && item.submenu.items.length > 0) {
|
||||
addMenuItemClickConnector(item.submenu.items, callback);
|
||||
}
|
||||
if ("id" in item && item.id) {
|
||||
item.click = function () { callback(item.id); };
|
||||
}
|
||||
});
|
||||
}
|
||||
socket.on('browserWindowSetProgressBar', function (id, progress) {
|
||||
getWindowById(id).setProgressBar(progress);
|
||||
});
|
||||
socket.on('browserWindowSetHasShadow', function (id, hasShadow) {
|
||||
getWindowById(id).setHasShadow(hasShadow);
|
||||
});
|
||||
socket.on('browserWindowHasShadow', function (id) {
|
||||
var hasShadow = getWindowById(id).hasShadow();
|
||||
socket.emit('browserWindow-hasShadow-completed', hasShadow);
|
||||
});
|
||||
socket.on('browserWindowSetThumbarButtons', function (id, thumbarButtons) {
|
||||
thumbarButtons.forEach(function (thumbarButton) {
|
||||
var imagePath = path.join(__dirname.replace('api', ''), 'bin', thumbarButton.icon.toString());
|
||||
thumbarButton.icon = electron_1.nativeImage.createFromPath(imagePath);
|
||||
thumbarButton.click = function () {
|
||||
socket.emit("thumbarButtonClicked", thumbarButton["id"]);
|
||||
};
|
||||
});
|
||||
var success = getWindowById(id).setThumbarButtons(thumbarButtons);
|
||||
socket.emit('browserWindowSetThumbarButtons-completed', success);
|
||||
});
|
||||
socket.on('browserWindowSetThumbnailClip', function (id, rectangle) {
|
||||
getWindowById(id).setThumbnailClip(rectangle);
|
||||
});
|
||||
socket.on('browserWindowSetThumbnailToolTip', function (id, toolTip) {
|
||||
getWindowById(id).setThumbnailToolTip(toolTip);
|
||||
});
|
||||
socket.on('browserWindowSetAppDetails', function (id, options) {
|
||||
getWindowById(id).setAppDetails(options);
|
||||
});
|
||||
socket.on('browserWindowShowDefinitionForSelection', function (id) {
|
||||
getWindowById(id).showDefinitionForSelection();
|
||||
});
|
||||
socket.on('browserWindowSetAutoHideMenuBar', function (id, hide) {
|
||||
getWindowById(id).setAutoHideMenuBar(hide);
|
||||
});
|
||||
socket.on('browserWindowIsMenuBarAutoHide', function (id) {
|
||||
var isMenuBarAutoHide = getWindowById(id).isMenuBarAutoHide();
|
||||
socket.emit('browserWindow-isMenuBarAutoHide-completed', isMenuBarAutoHide);
|
||||
});
|
||||
socket.on('browserWindowSetMenuBarVisibility', function (id, visible) {
|
||||
getWindowById(id).setMenuBarVisibility(visible);
|
||||
});
|
||||
socket.on('browserWindowIsMenuBarVisible', function (id) {
|
||||
var isMenuBarVisible = getWindowById(id).isMenuBarVisible();
|
||||
socket.emit('browserWindow-isMenuBarVisible-completed', isMenuBarVisible);
|
||||
});
|
||||
socket.on('browserWindowSetVisibleOnAllWorkspaces', function (id, visible) {
|
||||
getWindowById(id).setVisibleOnAllWorkspaces(visible);
|
||||
});
|
||||
socket.on('browserWindowIsVisibleOnAllWorkspaces', function (id) {
|
||||
var isVisibleOnAllWorkspaces = getWindowById(id).isVisibleOnAllWorkspaces();
|
||||
socket.emit('browserWindow-isVisibleOnAllWorkspaces-completed', isVisibleOnAllWorkspaces);
|
||||
});
|
||||
socket.on('browserWindowSetIgnoreMouseEvents', function (id, ignore) {
|
||||
getWindowById(id).setIgnoreMouseEvents(ignore);
|
||||
});
|
||||
socket.on('browserWindowSetContentProtection', function (id, enable) {
|
||||
getWindowById(id).setContentProtection(enable);
|
||||
});
|
||||
socket.on('browserWindowSetFocusable', function (id, focusable) {
|
||||
getWindowById(id).setFocusable(focusable);
|
||||
});
|
||||
socket.on('browserWindowSetParentWindow', function (id, parent) {
|
||||
var browserWindow = electron_1.BrowserWindow.fromId(parent.id);
|
||||
getWindowById(id).setParentWindow(browserWindow);
|
||||
});
|
||||
socket.on('browserWindowGetParentWindow', function (id) {
|
||||
var browserWindow = getWindowById(id).getParentWindow();
|
||||
socket.emit('browserWindow-getParentWindow-completed', browserWindow.id);
|
||||
});
|
||||
socket.on('browserWindowGetChildWindows', function (id) {
|
||||
var browserWindows = getWindowById(id).getChildWindows();
|
||||
var ids = [];
|
||||
browserWindows.forEach(function (x) {
|
||||
ids.push(x.id);
|
||||
});
|
||||
socket.emit('browserWindow-getChildWindows-completed', ids);
|
||||
});
|
||||
socket.on('browserWindowSetAutoHideCursor', function (id, autoHide) {
|
||||
getWindowById(id).setAutoHideCursor(autoHide);
|
||||
});
|
||||
socket.on('browserWindowSetVibrancy', function (id, type) {
|
||||
getWindowById(id).setVibrancy(type);
|
||||
});
|
||||
function getWindowById(id) {
|
||||
for (var index = 0; index < windows.length; index++) {
|
||||
var element = windows[index];
|
||||
if (element.id == id) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=browserWindows.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,50 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
module.exports = function (socket) {
|
||||
socket.on('clipboard-readText', function (type) {
|
||||
var text = electron_1.clipboard.readText(type);
|
||||
socket.emit('clipboard-readText-Completed', text);
|
||||
});
|
||||
socket.on('clipboard-writeText', function (text, type) {
|
||||
electron_1.clipboard.writeText(text, type);
|
||||
});
|
||||
socket.on('clipboard-readHTML', function (type) {
|
||||
var content = electron_1.clipboard.readHTML(type);
|
||||
socket.emit('clipboard-readHTML-Completed', content);
|
||||
});
|
||||
socket.on('clipboard-writeHTML', function (markup, type) {
|
||||
electron_1.clipboard.writeHTML(markup, type);
|
||||
});
|
||||
socket.on('clipboard-readRTF', function (type) {
|
||||
var content = electron_1.clipboard.readRTF(type);
|
||||
socket.emit('clipboard-readRTF-Completed', content);
|
||||
});
|
||||
socket.on('clipboard-writeRTF', function (text, type) {
|
||||
electron_1.clipboard.writeHTML(text, type);
|
||||
});
|
||||
socket.on('clipboard-readBookmark', function () {
|
||||
var bookmark = electron_1.clipboard.readBookmark();
|
||||
socket.emit('clipboard-readBookmark-Completed', bookmark);
|
||||
});
|
||||
socket.on('clipboard-writeBookmark', function (title, url, type) {
|
||||
electron_1.clipboard.writeBookmark(title, url, type);
|
||||
});
|
||||
socket.on('clipboard-readFindText', function () {
|
||||
var content = electron_1.clipboard.readFindText();
|
||||
socket.emit('clipboard-readFindText-Completed', content);
|
||||
});
|
||||
socket.on('clipboard-writeFindText', function (text) {
|
||||
electron_1.clipboard.writeFindText(text);
|
||||
});
|
||||
socket.on('clipboard-clear', function (type) {
|
||||
electron_1.clipboard.clear(type);
|
||||
});
|
||||
socket.on('clipboard-availableFormats', function (type) {
|
||||
var formats = electron_1.clipboard.availableFormats(type);
|
||||
socket.emit('clipboard-availableFormats-Completed', formats);
|
||||
});
|
||||
socket.on('clipboard-write', function (data, type) {
|
||||
electron_1.clipboard.write(data, type);
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=clipboard.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["clipboard.ts"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,iBAAS,UAAC,MAAuB;IAE7B,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAC,IAAI;QACjC,IAAM,IAAI,GAAG,oBAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,UAAC,IAAI,EAAE,IAAI;QACxC,oBAAS,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAC,IAAI;QACjC,IAAM,OAAO,GAAG,oBAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,UAAC,MAAM,EAAE,IAAI;QAC1C,oBAAS,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,mBAAmB,EAAE,UAAC,IAAI;QAChC,IAAM,OAAO,GAAG,oBAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAC,IAAI,EAAE,IAAI;QACvC,oBAAS,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,wBAAwB,EAAE;QAChC,IAAM,QAAQ,GAAG,oBAAS,CAAC,YAAY,EAAE,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,UAAC,KAAK,EAAE,GAAG,EAAE,IAAI;QAClD,oBAAS,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,wBAAwB,EAAE;QAChC,IAAM,OAAO,GAAG,oBAAS,CAAC,YAAY,EAAE,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,UAAC,IAAI;QACtC,oBAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,iBAAiB,EAAE,UAAC,IAAI;QAC9B,oBAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,4BAA4B,EAAE,UAAC,IAAI;QACzC,IAAM,OAAO,GAAG,oBAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,IAAI,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,iBAAiB,EAAE,UAAC,IAAI,EAAE,IAAI;QACpC,oBAAS,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC,CAAA"}
|
||||
@@ -1,41 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
module.exports = function (socket) {
|
||||
socket.on('showMessageBox', function (browserWindow, options, guid) {
|
||||
if ("id" in browserWindow) {
|
||||
var window = electron_1.BrowserWindow.fromId(browserWindow.id);
|
||||
electron_1.dialog.showMessageBox(window, options, function (response, checkboxChecked) {
|
||||
socket.emit('showMessageBoxComplete' + guid, [response, checkboxChecked]);
|
||||
});
|
||||
}
|
||||
else {
|
||||
var message = browserWindow;
|
||||
var id_1 = guid || options;
|
||||
electron_1.dialog.showMessageBox(browserWindow, function (response, checkboxChecked) {
|
||||
socket.emit('showMessageBoxComplete' + id_1, [response, checkboxChecked]);
|
||||
});
|
||||
}
|
||||
});
|
||||
socket.on('showOpenDialog', function (browserWindow, options, guid) {
|
||||
var window = electron_1.BrowserWindow.fromId(browserWindow.id);
|
||||
electron_1.dialog.showOpenDialog(window, options, function (filePaths) {
|
||||
socket.emit('showOpenDialogComplete' + guid, filePaths || []);
|
||||
});
|
||||
});
|
||||
socket.on('showSaveDialog', function (browserWindow, options, guid) {
|
||||
var window = electron_1.BrowserWindow.fromId(browserWindow.id);
|
||||
electron_1.dialog.showSaveDialog(window, options, function (filename) {
|
||||
socket.emit('showSaveDialogComplete' + guid, filename || '');
|
||||
});
|
||||
});
|
||||
socket.on('showErrorBox', function (title, content) {
|
||||
electron_1.dialog.showErrorBox(title, content);
|
||||
});
|
||||
socket.on('showCertificateTrustDialog', function (browserWindow, options, guid) {
|
||||
var window = electron_1.BrowserWindow.fromId(browserWindow.id);
|
||||
electron_1.dialog.showCertificateTrustDialog(window, options, function () {
|
||||
socket.emit('showCertificateTrustDialogComplete' + guid);
|
||||
});
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=dialog.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["dialog.ts"],"names":[],"mappings":";AAAA,qCAAiD;AAEjD,iBAAS,UAAC,MAAuB;IAC7B,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,UAAC,aAAa,EAAE,OAAO,EAAE,IAAI;QACrD,IAAI,IAAI,IAAI,aAAa,EAAE;YACvB,IAAI,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;YAEpD,iBAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,UAAC,QAAQ,EAAE,eAAe;gBAC7D,MAAM,CAAC,IAAI,CAAC,wBAAwB,GAAG,IAAI,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC;YAC9E,CAAC,CAAC,CAAC;SACN;aAAM;YACH,IAAI,OAAO,GAAG,aAAa,CAAC;YAC5B,IAAI,IAAE,GAAG,IAAI,IAAI,OAAO,CAAC;YACzB,iBAAM,CAAC,cAAc,CAAC,aAAa,EAAE,UAAC,QAAQ,EAAE,eAAe;gBAC3D,MAAM,CAAC,IAAI,CAAC,wBAAwB,GAAG,IAAE,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC;YAC5E,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,UAAC,aAAa,EAAE,OAAO,EAAE,IAAI;QACrD,IAAI,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACpD,iBAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,UAAC,SAAS;YAC7C,MAAM,CAAC,IAAI,CAAC,wBAAwB,GAAG,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,UAAC,aAAa,EAAE,OAAO,EAAE,IAAI;QACrD,IAAI,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACpD,iBAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,UAAC,QAAQ;YAC5C,MAAM,CAAC,IAAI,CAAC,wBAAwB,GAAG,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,EAAE,OAAO;QACrC,iBAAM,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,4BAA4B,EAAE,UAAC,aAAa,EAAE,OAAO,EAAE,IAAI;QACjE,IAAI,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACpD,iBAAM,CAAC,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE;YAC/C,MAAM,CAAC,IAAI,CAAC,oCAAoC,GAAG,IAAI,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAA"}
|
||||
@@ -1,44 +0,0 @@
|
||||
import { BrowserWindow, dialog } from "electron";
|
||||
|
||||
export = (socket: SocketIO.Socket) => {
|
||||
socket.on('showMessageBox', (browserWindow, options, guid) => {
|
||||
if ("id" in browserWindow) {
|
||||
var window = BrowserWindow.fromId(browserWindow.id);
|
||||
|
||||
dialog.showMessageBox(window, options, (response, checkboxChecked) => {
|
||||
socket.emit('showMessageBoxComplete' + guid, [response, checkboxChecked]);
|
||||
});
|
||||
} else {
|
||||
var message = browserWindow;
|
||||
let id = guid || options;
|
||||
dialog.showMessageBox(browserWindow, (response, checkboxChecked) => {
|
||||
socket.emit('showMessageBoxComplete' + id, [response, checkboxChecked]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('showOpenDialog', (browserWindow, options, guid) => {
|
||||
var window = BrowserWindow.fromId(browserWindow.id);
|
||||
dialog.showOpenDialog(window, options, (filePaths) => {
|
||||
socket.emit('showOpenDialogComplete' + guid, filePaths || []);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('showSaveDialog', (browserWindow, options, guid) => {
|
||||
var window = BrowserWindow.fromId(browserWindow.id);
|
||||
dialog.showSaveDialog(window, options, (filename) => {
|
||||
socket.emit('showSaveDialogComplete' + guid, filename || '');
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('showErrorBox', (title, content) => {
|
||||
dialog.showErrorBox(title, content);
|
||||
});
|
||||
|
||||
socket.on('showCertificateTrustDialog', (browserWindow, options, guid) => {
|
||||
var window = BrowserWindow.fromId(browserWindow.id);
|
||||
dialog.showCertificateTrustDialog(window, options, () => {
|
||||
socket.emit('showCertificateTrustDialogComplete' + guid);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
module.exports = function (socket) {
|
||||
socket.on('globalShortcut-register', function (accelerator) {
|
||||
electron_1.globalShortcut.register(accelerator, function () {
|
||||
socket.emit('globalShortcut-pressed', accelerator);
|
||||
});
|
||||
});
|
||||
socket.on('globalShortcut-isRegistered', function (accelerator) {
|
||||
var isRegistered = electron_1.globalShortcut.isRegistered(accelerator);
|
||||
socket.emit('globalShortcut-isRegisteredCompleted', isRegistered);
|
||||
});
|
||||
socket.on('globalShortcut-unregister', function (accelerator) {
|
||||
electron_1.globalShortcut.unregister(accelerator);
|
||||
});
|
||||
socket.on('globalShortcut-unregisterAll', function () {
|
||||
try {
|
||||
electron_1.globalShortcut.unregisterAll();
|
||||
}
|
||||
catch (error) { }
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=globalShortcut.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"globalShortcut.js","sourceRoot":"","sources":["globalShortcut.ts"],"names":[],"mappings":";AAAA,qCAA0C;AAE1C,iBAAS,UAAC,MAAuB;IAC7B,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,UAAC,WAAW;QAC7C,yBAAc,CAAC,QAAQ,CAAC,WAAW,EAAE;YACjC,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,WAAW,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,6BAA6B,EAAE,UAAC,WAAW;QACjD,IAAM,YAAY,GAAG,yBAAc,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAE9D,MAAM,CAAC,IAAI,CAAC,sCAAsC,EAAE,YAAY,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,2BAA2B,EAAE,UAAC,WAAW;QAC/C,yBAAc,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,8BAA8B,EAAE;QACtC,IAAI;YACA,yBAAc,CAAC,aAAa,EAAE,CAAC;SAClC;QAAC,OAAO,KAAK,EAAE,GAAG;IACvB,CAAC,CAAC,CAAC;AACP,CAAC,CAAA"}
|
||||
@@ -1,39 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
module.exports = function (socket) {
|
||||
socket.on('registerIpcMainChannel', function (channel) {
|
||||
electron_1.ipcMain.on(channel, function (event, args) {
|
||||
socket.emit(channel, [event.preventDefault(), args]);
|
||||
});
|
||||
});
|
||||
socket.on('registerSyncIpcMainChannel', function (channel) {
|
||||
electron_1.ipcMain.on(channel, function (event, args) {
|
||||
var x = socket;
|
||||
x.removeAllListeners(channel + 'Sync');
|
||||
socket.on(channel + 'Sync', function (result) {
|
||||
event.returnValue = result;
|
||||
});
|
||||
socket.emit(channel, [event.preventDefault(), args]);
|
||||
});
|
||||
});
|
||||
socket.on('registerOnceIpcMainChannel', function (channel) {
|
||||
electron_1.ipcMain.once(channel, function (event, args) {
|
||||
socket.emit(channel, [event.preventDefault(), args]);
|
||||
});
|
||||
});
|
||||
socket.on('removeAllListenersIpcMainChannel', function (channel) {
|
||||
electron_1.ipcMain.removeAllListeners(channel);
|
||||
});
|
||||
socket.on('sendToIpcRenderer', function (browserWindow, channel) {
|
||||
var data = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
data[_i - 2] = arguments[_i];
|
||||
}
|
||||
var _a;
|
||||
var window = electron_1.BrowserWindow.fromId(browserWindow.id);
|
||||
if (window) {
|
||||
(_a = window.webContents).send.apply(_a, [channel].concat(data));
|
||||
}
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=ipc.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"ipc.js","sourceRoot":"","sources":["ipc.ts"],"names":[],"mappings":";AAAA,qCAAkD;AAElD,iBAAS,UAAC,MAAuB;IAC7B,MAAM,CAAC,EAAE,CAAC,wBAAwB,EAAE,UAAC,OAAO;QACxC,kBAAO,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,KAAK,EAAE,IAAI;YAC5B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,4BAA4B,EAAE,UAAC,OAAO;QAC5C,kBAAO,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,KAAK,EAAE,IAAI;YAC5B,IAAI,CAAC,GAAQ,MAAM,CAAC;YACpB,CAAC,CAAC,kBAAkB,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;YACvC,MAAM,CAAC,EAAE,CAAC,OAAO,GAAG,MAAM,EAAE,UAAC,MAAM;gBAC/B,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC;YAC/B,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,4BAA4B,EAAE,UAAC,OAAO;QAC5C,kBAAO,CAAC,IAAI,CAAC,OAAO,EAAE,UAAC,KAAK,EAAE,IAAI;YAC9B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,kCAAkC,EAAE,UAAC,OAAO;QAClD,kBAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,mBAAmB,EAAE,UAAC,aAAa,EAAE,OAAO;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;;QAC3D,IAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAEtD,IAAI,MAAM,EAAE;YACR,CAAA,KAAA,MAAM,CAAC,WAAW,CAAA,CAAC,IAAI,YAAC,OAAO,SAAK,IAAI,GAAE;SAC7C;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAA"}
|
||||
@@ -1,39 +0,0 @@
|
||||
import { ipcMain, BrowserWindow } from 'electron';
|
||||
|
||||
export = (socket: SocketIO.Socket) => {
|
||||
socket.on('registerIpcMainChannel', (channel) => {
|
||||
ipcMain.on(channel, (event, args) => {
|
||||
socket.emit(channel, [event.preventDefault(), args]);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('registerSyncIpcMainChannel', (channel) => {
|
||||
ipcMain.on(channel, (event, args) => {
|
||||
let x = <any>socket;
|
||||
x.removeAllListeners(channel + 'Sync');
|
||||
socket.on(channel + 'Sync', (result) => {
|
||||
event.returnValue = result;
|
||||
});
|
||||
|
||||
socket.emit(channel, [event.preventDefault(), args]);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('registerOnceIpcMainChannel', (channel) => {
|
||||
ipcMain.once(channel, (event, args) => {
|
||||
socket.emit(channel, [event.preventDefault(), args]);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('removeAllListenersIpcMainChannel', (channel) => {
|
||||
ipcMain.removeAllListeners(channel);
|
||||
});
|
||||
|
||||
socket.on('sendToIpcRenderer', (browserWindow, channel, ...data) => {
|
||||
const window = BrowserWindow.fromId(browserWindow.id);
|
||||
|
||||
if (window) {
|
||||
window.webContents.send(channel, ...data);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
var contextMenuItems = [];
|
||||
module.exports = function (socket) {
|
||||
socket.on('menu-setContextMenu', function (browserWindowId, menuItems) {
|
||||
var menu = electron_1.Menu.buildFromTemplate(menuItems);
|
||||
addContextMenuItemClickConnector(menu.items, browserWindowId, function (id, browserWindowId) {
|
||||
socket.emit("contextMenuItemClicked", [id, browserWindowId]);
|
||||
});
|
||||
contextMenuItems.push({
|
||||
menu: menu,
|
||||
browserWindowId: browserWindowId
|
||||
});
|
||||
});
|
||||
function addContextMenuItemClickConnector(menuItems, browserWindowId, callback) {
|
||||
menuItems.forEach(function (item) {
|
||||
if (item.submenu && item.submenu.items.length > 0) {
|
||||
addContextMenuItemClickConnector(item.submenu.items, browserWindowId, callback);
|
||||
}
|
||||
if ("id" in item && item.id) {
|
||||
item.click = function () { callback(item.id, browserWindowId); };
|
||||
}
|
||||
});
|
||||
}
|
||||
socket.on('menu-contextMenuPopup', function (browserWindowId) {
|
||||
contextMenuItems.forEach(function (x) {
|
||||
if (x.browserWindowId === browserWindowId) {
|
||||
var browserWindow = electron_1.BrowserWindow.fromId(browserWindowId);
|
||||
x.menu.popup(browserWindow);
|
||||
}
|
||||
});
|
||||
});
|
||||
socket.on('menu-setApplicationMenu', function (menuItems) {
|
||||
var menu = electron_1.Menu.buildFromTemplate(menuItems);
|
||||
addMenuItemClickConnector(menu.items, function (id) {
|
||||
socket.emit("menuItemClicked", id);
|
||||
});
|
||||
electron_1.Menu.setApplicationMenu(menu);
|
||||
});
|
||||
function addMenuItemClickConnector(menuItems, callback) {
|
||||
menuItems.forEach(function (item) {
|
||||
if (item.submenu && item.submenu.items.length > 0) {
|
||||
addMenuItemClickConnector(item.submenu.items, callback);
|
||||
}
|
||||
if ("id" in item && item.id) {
|
||||
item.click = function () { callback(item.id); };
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=menu.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"menu.js","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":";AAAA,qCAA+C;AAC/C,IAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,iBAAS,UAAC,MAAuB;IAC7B,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,UAAC,eAAe,EAAE,SAAS;QACxD,IAAM,IAAI,GAAG,eAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAE/C,gCAAgC,CAAC,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,UAAC,EAAE,EAAE,eAAe;YAC9E,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;QAEH,gBAAgB,CAAC,IAAI,CAAC;YAClB,IAAI,EAAE,IAAI;YACV,eAAe,EAAE,eAAe;SACnC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,SAAS,gCAAgC,CAAC,SAAS,EAAE,eAAe,EAAE,QAAQ;QAC1E,SAAS,CAAC,OAAO,CAAC,UAAC,IAAI;YACnB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC/C,gCAAgC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;aACnF;YAED,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE;gBACzB,IAAI,CAAC,KAAK,GAAG,cAAQ,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9D;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE,UAAC,eAAe;QAC/C,gBAAgB,CAAC,OAAO,CAAC,UAAA,CAAC;YACtB,IAAG,CAAC,CAAC,eAAe,KAAK,eAAe,EAAE;gBACtC,IAAI,aAAa,GAAG,wBAAa,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;gBAC1D,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;aAC/B;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,UAAC,SAAS;QAC3C,IAAM,IAAI,GAAG,eAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAE/C,yBAAyB,CAAC,IAAI,CAAC,KAAK,EAAE,UAAC,EAAE;YACrC,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,eAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,SAAS,yBAAyB,CAAC,SAAS,EAAE,QAAQ;QAClD,SAAS,CAAC,OAAO,CAAC,UAAC,IAAI;YACnB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC/C,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;aAC3D;YAED,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE;gBACzB,IAAI,CAAC,KAAK,GAAG,cAAQ,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C;QACL,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAA"}
|
||||
@@ -1,48 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
var notifications = [];
|
||||
module.exports = function (socket) {
|
||||
socket.on('createNotification', function (options) {
|
||||
var notification = new electron_1.Notification(options);
|
||||
var haveEvent = false;
|
||||
if (options.showID) {
|
||||
haveEvent = true;
|
||||
notification.on('show', function () {
|
||||
socket.emit('NotificationEventShow', options.showID);
|
||||
});
|
||||
}
|
||||
if (options.clickID) {
|
||||
haveEvent = true;
|
||||
notification.on('click', function () {
|
||||
socket.emit('NotificationEventClick', options.clickID);
|
||||
});
|
||||
}
|
||||
if (options.closeID) {
|
||||
haveEvent = true;
|
||||
notification.on('close', function () {
|
||||
socket.emit('NotificationEventClose', options.closeID);
|
||||
});
|
||||
}
|
||||
if (options.replyID) {
|
||||
haveEvent = true;
|
||||
notification.on('reply', function (event, value) {
|
||||
socket.emit('NotificationEventReply', [options.replyID, value]);
|
||||
});
|
||||
}
|
||||
if (options.actionID) {
|
||||
haveEvent = true;
|
||||
notification.on('action', function (event, value) {
|
||||
socket.emit('NotificationEventAction', [options.actionID, value]);
|
||||
});
|
||||
}
|
||||
if (haveEvent) {
|
||||
notifications.push(notification);
|
||||
}
|
||||
notification.show();
|
||||
});
|
||||
socket.on('notificationIsSupported', function (options) {
|
||||
var isSupported = electron_1.Notification.isSupported;
|
||||
socket.emit('notificationIsSupportedComplete', isSupported);
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=notification.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"notification.js","sourceRoot":"","sources":["notification.ts"],"names":[],"mappings":";AAAA,qCAAwC;AACxC,IAAM,aAAa,GAA4B,EAAE,CAAC;AAElD,iBAAS,UAAC,MAAuB;IAC7B,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAC,OAAO;QACpC,IAAM,YAAY,GAAG,IAAI,uBAAY,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,IAAG,OAAO,CAAC,MAAM,EAAE;YACf,SAAS,GAAG,IAAI,CAAC;YACjB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE;gBACpB,MAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;SACN;QAED,IAAG,OAAO,CAAC,OAAO,EAAE;YAChB,SAAS,GAAG,IAAI,CAAC;YACjB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE;gBACrB,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC3D,CAAC,CAAC,CAAC;SACN;QAED,IAAG,OAAO,CAAC,OAAO,EAAE;YAChB,SAAS,GAAG,IAAI,CAAC;YACjB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE;gBACrB,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC3D,CAAC,CAAC,CAAC;SACN;QAED,IAAG,OAAO,CAAC,OAAO,EAAE;YAChB,SAAS,GAAG,IAAI,CAAC;YACjB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,KAAK,EAAE,KAAK;gBAClC,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;YACpE,CAAC,CAAC,CAAC;SACN;QAED,IAAG,OAAO,CAAC,QAAQ,EAAE;YACjB,SAAS,GAAG,IAAI,CAAC;YACjB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAC,KAAK,EAAE,KAAK;gBACnC,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;YACtE,CAAC,CAAC,CAAC;SACN;QAED,IAAG,SAAS,EAAE;YACV,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACpC;QAED,YAAY,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,UAAC,OAAO;QACzC,IAAM,WAAW,GAAG,uBAAY,CAAC,WAAW,CAAC;QAC7C,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE,WAAW,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACP,CAAC,CAAA"}
|
||||
@@ -1,55 +0,0 @@
|
||||
import { Notification } from "electron";
|
||||
const notifications: Electron.Notification[] = [];
|
||||
|
||||
export = (socket: SocketIO.Socket) => {
|
||||
socket.on('createNotification', (options) => {
|
||||
const notification = new Notification(options);
|
||||
let haveEvent = false;
|
||||
|
||||
if(options.showID) {
|
||||
haveEvent = true;
|
||||
notification.on('show', () => {
|
||||
socket.emit('NotificationEventShow', options.showID);
|
||||
});
|
||||
}
|
||||
|
||||
if(options.clickID) {
|
||||
haveEvent = true;
|
||||
notification.on('click', () => {
|
||||
socket.emit('NotificationEventClick', options.clickID);
|
||||
});
|
||||
}
|
||||
|
||||
if(options.closeID) {
|
||||
haveEvent = true;
|
||||
notification.on('close', () => {
|
||||
socket.emit('NotificationEventClose', options.closeID);
|
||||
});
|
||||
}
|
||||
|
||||
if(options.replyID) {
|
||||
haveEvent = true;
|
||||
notification.on('reply', (event, value) => {
|
||||
socket.emit('NotificationEventReply', [options.replyID, value]);
|
||||
});
|
||||
}
|
||||
|
||||
if(options.actionID) {
|
||||
haveEvent = true;
|
||||
notification.on('action', (event, value) => {
|
||||
socket.emit('NotificationEventAction', [options.actionID, value]);
|
||||
});
|
||||
}
|
||||
|
||||
if(haveEvent) {
|
||||
notifications.push(notification);
|
||||
}
|
||||
|
||||
notification.show();
|
||||
});
|
||||
|
||||
socket.on('notificationIsSupported', (options) => {
|
||||
const isSupported = Notification.isSupported;
|
||||
socket.emit('notificationIsSupportedComplete', isSupported);
|
||||
});
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
module.exports = function (socket) {
|
||||
socket.on('register-screen-display-added', function (id) {
|
||||
electron_1.screen.on('display-added', function (event, display) {
|
||||
socket.emit('screen-display-added-event' + id, display);
|
||||
});
|
||||
});
|
||||
socket.on('register-screen-display-removed', function (id) {
|
||||
electron_1.screen.on('display-removed', function (event, display) {
|
||||
socket.emit('screen-display-removed-event' + id, display);
|
||||
});
|
||||
});
|
||||
socket.on('register-screen-display-metrics-changed', function (id) {
|
||||
electron_1.screen.on('display-metrics-changed', function (event, display, changedMetrics) {
|
||||
socket.emit('screen-display-metrics-changed-event' + id, [display, changedMetrics]);
|
||||
});
|
||||
});
|
||||
socket.on('screen-getCursorScreenPoint', function () {
|
||||
var point = electron_1.screen.getCursorScreenPoint();
|
||||
socket.emit('screen-getCursorScreenPointCompleted', point);
|
||||
});
|
||||
socket.on('screen-getMenuBarHeight', function () {
|
||||
var height = electron_1.screen.getPrimaryDisplay().workArea;
|
||||
socket.emit('screen-getMenuBarHeightCompleted', height);
|
||||
});
|
||||
socket.on('screen-getPrimaryDisplay', function () {
|
||||
var display = electron_1.screen.getPrimaryDisplay();
|
||||
socket.emit('screen-getPrimaryDisplayCompleted', display);
|
||||
});
|
||||
socket.on('screen-getAllDisplays', function () {
|
||||
var display = electron_1.screen.getAllDisplays();
|
||||
socket.emit('screen-getAllDisplaysCompleted', display);
|
||||
});
|
||||
socket.on('screen-getDisplayNearestPoint', function (point) {
|
||||
var display = electron_1.screen.getDisplayNearestPoint(point);
|
||||
socket.emit('screen-getDisplayNearestPointCompleted', display);
|
||||
});
|
||||
socket.on('screen-getDisplayMatching', function (rectangle) {
|
||||
var display = electron_1.screen.getDisplayMatching(rectangle);
|
||||
socket.emit('screen-getDisplayMatchingCompleted', display);
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=screen.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"screen.js","sourceRoot":"","sources":["screen.ts"],"names":[],"mappings":";AAAA,qCAAkC;AAElC,iBAAS,UAAC,MAAuB;IAC7B,MAAM,CAAC,EAAE,CAAC,+BAA+B,EAAE,UAAC,EAAE;QAC1C,iBAAM,CAAC,EAAE,CAAC,eAAe,EAAE,UAAC,KAAK,EAAE,OAAO;YACtC,MAAM,CAAC,IAAI,CAAC,4BAA4B,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,iCAAiC,EAAE,UAAC,EAAE;QAC5C,iBAAM,CAAC,EAAE,CAAC,iBAAiB,EAAE,UAAC,KAAK,EAAE,OAAO;YACxC,MAAM,CAAC,IAAI,CAAC,8BAA8B,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,yCAAyC,EAAE,UAAC,EAAE;QACpD,iBAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,UAAC,KAAK,EAAE,OAAO,EAAE,cAAc;YAChE,MAAM,CAAC,IAAI,CAAC,sCAAsC,GAAG,EAAE,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;QACxF,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,6BAA6B,EAAE;QACrC,IAAI,KAAK,GAAG,iBAAM,CAAC,oBAAoB,EAAE,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE;QACjC,IAAI,MAAM,GAAG,iBAAM,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC;QACjD,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,0BAA0B,EAAE;QAClC,IAAI,OAAO,GAAG,iBAAM,CAAC,iBAAiB,EAAE,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,mCAAmC,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE;QAC/B,IAAI,OAAO,GAAG,iBAAM,CAAC,cAAc,EAAE,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,+BAA+B,EAAE,UAAC,KAAK;QAC7C,IAAI,OAAO,GAAG,iBAAM,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,CAAC,IAAI,CAAC,wCAAwC,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,2BAA2B,EAAE,UAAC,SAAS;QAC7C,IAAI,OAAO,GAAG,iBAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,CAAC,IAAI,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACP,CAAC,CAAA"}
|
||||
@@ -1,51 +0,0 @@
|
||||
import { screen } from "electron";
|
||||
|
||||
export = (socket: SocketIO.Socket) => {
|
||||
socket.on('register-screen-display-added', (id) => {
|
||||
screen.on('display-added', (event, display) => {
|
||||
socket.emit('screen-display-added-event' + id, display);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-screen-display-removed', (id) => {
|
||||
screen.on('display-removed', (event, display) => {
|
||||
socket.emit('screen-display-removed-event' + id, display);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-screen-display-metrics-changed', (id) => {
|
||||
screen.on('display-metrics-changed', (event, display, changedMetrics) => {
|
||||
socket.emit('screen-display-metrics-changed-event' + id, [display, changedMetrics]);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('screen-getCursorScreenPoint', () => {
|
||||
var point = screen.getCursorScreenPoint();
|
||||
socket.emit('screen-getCursorScreenPointCompleted', point);
|
||||
});
|
||||
|
||||
socket.on('screen-getMenuBarHeight', () => {
|
||||
var height = screen.getPrimaryDisplay().workArea;
|
||||
socket.emit('screen-getMenuBarHeightCompleted', height);
|
||||
});
|
||||
|
||||
socket.on('screen-getPrimaryDisplay', () => {
|
||||
var display = screen.getPrimaryDisplay();
|
||||
socket.emit('screen-getPrimaryDisplayCompleted', display);
|
||||
});
|
||||
|
||||
socket.on('screen-getAllDisplays', () => {
|
||||
var display = screen.getAllDisplays();
|
||||
socket.emit('screen-getAllDisplaysCompleted', display);
|
||||
});
|
||||
|
||||
socket.on('screen-getDisplayNearestPoint', (point) => {
|
||||
var display = screen.getDisplayNearestPoint(point);
|
||||
socket.emit('screen-getDisplayNearestPointCompleted', display);
|
||||
});
|
||||
|
||||
socket.on('screen-getDisplayMatching', (rectangle) => {
|
||||
var display = screen.getDisplayMatching(rectangle);
|
||||
socket.emit('screen-getDisplayMatchingCompleted', display);
|
||||
});
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
module.exports = function (socket) {
|
||||
socket.on('shell-showItemInFolder', function (fullPath) {
|
||||
var success = electron_1.shell.showItemInFolder(fullPath);
|
||||
socket.emit('shell-showItemInFolderCompleted', success);
|
||||
});
|
||||
socket.on('shell-openItem', function (fullPath) {
|
||||
var success = electron_1.shell.openItem(fullPath);
|
||||
socket.emit('shell-openItemCompleted', success);
|
||||
});
|
||||
socket.on('shell-openExternal', function (url, options, callback) {
|
||||
var success = false;
|
||||
if (options && callback) {
|
||||
success = electron_1.shell.openExternal(url, options, function (error) {
|
||||
socket.emit('shell-openExternalCallback', [url, error]);
|
||||
});
|
||||
}
|
||||
else if (options) {
|
||||
success = electron_1.shell.openExternal(url, options);
|
||||
}
|
||||
else {
|
||||
success = electron_1.shell.openExternal(url);
|
||||
}
|
||||
socket.emit('shell-openExternalCompleted', success);
|
||||
});
|
||||
socket.on('shell-moveItemToTrash', function (fullPath) {
|
||||
var success = electron_1.shell.moveItemToTrash(fullPath);
|
||||
socket.emit('shell-moveItemToTrashCompleted', success);
|
||||
});
|
||||
socket.on('shell-beep', function () {
|
||||
electron_1.shell.beep();
|
||||
});
|
||||
socket.on('shell-writeShortcutLink', function (shortcutPath, operation, options) {
|
||||
var success = electron_1.shell.writeShortcutLink(shortcutPath, operation, options);
|
||||
socket.emit('shell-writeShortcutLinkCompleted', success);
|
||||
});
|
||||
socket.on('shell-readShortcutLink', function (shortcutPath) {
|
||||
var shortcutDetails = electron_1.shell.readShortcutLink(shortcutPath);
|
||||
socket.emit('shell-readShortcutLinkCompleted', shortcutDetails);
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=shell.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"shell.js","sourceRoot":"","sources":["shell.ts"],"names":[],"mappings":";AAAA,qCAAiC;AAEjC,iBAAS,UAAC,MAAuB;IAC7B,MAAM,CAAC,EAAE,CAAC,wBAAwB,EAAE,UAAC,QAAQ;QACzC,IAAM,OAAO,GAAG,gBAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAEjD,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,UAAC,QAAQ;QACjC,IAAM,OAAO,GAAG,gBAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEzC,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAC,GAAG,EAAE,OAAO,EAAE,QAAQ;QACnD,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,IAAI,OAAO,IAAI,QAAQ,EAAE;YACrB,OAAO,GAAG,gBAAK,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,UAAC,KAAK;gBAC7C,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;SACN;aAAM,IAAI,OAAO,EAAE;YAChB,OAAO,GAAG,gBAAK,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;SAC9C;aAAM;YACH,OAAO,GAAG,gBAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;SACrC;QAED,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE,UAAC,QAAQ;QACxC,IAAM,OAAO,GAAG,gBAAK,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAEhD,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE;QACpB,gBAAK,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,UAAC,YAAY,EAAE,SAAS,EAAE,OAAO;QAClE,IAAM,OAAO,GAAG,gBAAK,CAAC,iBAAiB,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAE1E,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,wBAAwB,EAAE,UAAC,YAAY;QAC7C,IAAM,eAAe,GAAG,gBAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAE7D,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE,eAAe,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC,CAAA"}
|
||||
@@ -1,53 +0,0 @@
|
||||
import { shell } from "electron";
|
||||
|
||||
export = (socket: SocketIO.Socket) => {
|
||||
socket.on('shell-showItemInFolder', (fullPath) => {
|
||||
const success = shell.showItemInFolder(fullPath);
|
||||
|
||||
socket.emit('shell-showItemInFolderCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('shell-openItem', (fullPath) => {
|
||||
const success = shell.openItem(fullPath);
|
||||
|
||||
socket.emit('shell-openItemCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('shell-openExternal', (url, options, callback) => {
|
||||
let success = false;
|
||||
|
||||
if (options && callback) {
|
||||
success = shell.openExternal(url, options, (error) => {
|
||||
socket.emit('shell-openExternalCallback', [url, error]);
|
||||
});
|
||||
} else if (options) {
|
||||
success = shell.openExternal(url, options);
|
||||
} else {
|
||||
success = shell.openExternal(url);
|
||||
}
|
||||
|
||||
socket.emit('shell-openExternalCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('shell-moveItemToTrash', (fullPath) => {
|
||||
const success = shell.moveItemToTrash(fullPath);
|
||||
|
||||
socket.emit('shell-moveItemToTrashCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('shell-beep', () => {
|
||||
shell.beep();
|
||||
});
|
||||
|
||||
socket.on('shell-writeShortcutLink', (shortcutPath, operation, options) => {
|
||||
const success = shell.writeShortcutLink(shortcutPath, operation, options);
|
||||
|
||||
socket.emit('shell-writeShortcutLinkCompleted', success);
|
||||
});
|
||||
|
||||
socket.on('shell-readShortcutLink', (shortcutPath) => {
|
||||
const shortcutDetails = shell.readShortcutLink(shortcutPath);
|
||||
|
||||
socket.emit('shell-readShortcutLinkCompleted', shortcutDetails);
|
||||
});
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
var path = require('path');
|
||||
var tray;
|
||||
module.exports = function (socket) {
|
||||
socket.on('register-tray-click', function (id) {
|
||||
if (tray) {
|
||||
tray.on('click', function (event, bounds) {
|
||||
socket.emit('tray-click-event' + id, [event.__proto__, bounds]);
|
||||
});
|
||||
}
|
||||
});
|
||||
socket.on('register-tray-right-click', function (id) {
|
||||
if (tray) {
|
||||
tray.on('right-click', function (event, bounds) {
|
||||
socket.emit('tray-right-click-event' + id, [event.__proto__, bounds]);
|
||||
});
|
||||
}
|
||||
});
|
||||
socket.on('register-tray-double-click', function (id) {
|
||||
if (tray) {
|
||||
tray.on('double-click', function (event, bounds) {
|
||||
socket.emit('tray-double-click-event' + id, [event.__proto__, bounds]);
|
||||
});
|
||||
}
|
||||
});
|
||||
socket.on('register-tray-balloon-show', function (id) {
|
||||
if (tray) {
|
||||
tray.on('balloon-show', function () {
|
||||
socket.emit('tray-balloon-show-event' + id);
|
||||
});
|
||||
}
|
||||
});
|
||||
socket.on('register-tray-balloon-click', function (id) {
|
||||
if (tray) {
|
||||
tray.on('balloon-click', function () {
|
||||
socket.emit('tray-balloon-click-event' + id);
|
||||
});
|
||||
}
|
||||
});
|
||||
socket.on('register-tray-balloon-closed', function (id) {
|
||||
if (tray) {
|
||||
tray.on('balloon-closed', function () {
|
||||
socket.emit('tray-balloon-closed-event' + id);
|
||||
});
|
||||
}
|
||||
});
|
||||
socket.on('create-tray', function (image, menuItems) {
|
||||
var menu = electron_1.Menu.buildFromTemplate(menuItems);
|
||||
addMenuItemClickConnector(menu.items, function (id) {
|
||||
socket.emit("trayMenuItemClicked", id);
|
||||
});
|
||||
var imagePath = path.join(__dirname.replace('api', ''), 'bin', image);
|
||||
tray = new electron_1.Tray(imagePath);
|
||||
tray.setContextMenu(menu);
|
||||
});
|
||||
socket.on('tray-destroy', function () {
|
||||
if (tray) {
|
||||
tray.destroy();
|
||||
}
|
||||
});
|
||||
socket.on('tray-setImage', function (image) {
|
||||
if (tray) {
|
||||
tray.setImage(image);
|
||||
}
|
||||
});
|
||||
socket.on('tray-setPressedImage', function (image) {
|
||||
if (tray) {
|
||||
var img = electron_1.nativeImage.createFromPath(image);
|
||||
tray.setPressedImage(img);
|
||||
}
|
||||
});
|
||||
socket.on('tray-setToolTip', function (toolTip) {
|
||||
if (tray) {
|
||||
tray.setToolTip(toolTip);
|
||||
}
|
||||
});
|
||||
socket.on('tray-setTitle', function (title) {
|
||||
if (tray) {
|
||||
tray.setTitle(title);
|
||||
}
|
||||
});
|
||||
socket.on('tray-setHighlightMode', function (mode) {
|
||||
if (tray) {
|
||||
tray.setHighlightMode(mode);
|
||||
}
|
||||
});
|
||||
socket.on('tray-displayBalloon', function (options) {
|
||||
if (tray) {
|
||||
tray.displayBalloon(options);
|
||||
}
|
||||
});
|
||||
socket.on('tray-isDestroyed', function () {
|
||||
if (tray) {
|
||||
var isDestroyed = tray.isDestroyed();
|
||||
socket.emit('tray-isDestroyedCompleted', isDestroyed);
|
||||
}
|
||||
});
|
||||
function addMenuItemClickConnector(menuItems, callback) {
|
||||
menuItems.forEach(function (item) {
|
||||
if (item.submenu && item.submenu.items.length > 0) {
|
||||
addMenuItemClickConnector(item.submenu.items, callback);
|
||||
}
|
||||
if ("id" in item && item.id) {
|
||||
item.click = function () { callback(item.id); };
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=tray.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"tray.js","sourceRoot":"","sources":["tray.ts"],"names":[],"mappings":";AAAA,qCAAmD;AACnD,IAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,IAAI,IAAmB,CAAC;AAExB,iBAAS,UAAC,MAAuB;IAC7B,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,UAAC,EAAE;QAChC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,KAAK,EAAE,MAAM;gBAC3B,MAAM,CAAC,IAAI,CAAC,kBAAkB,GAAG,EAAE,EAAE,CAAO,KAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;YAC3E,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,2BAA2B,EAAE,UAAC,EAAE;QACtC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,EAAE,MAAM;gBACjC,MAAM,CAAC,IAAI,CAAC,wBAAwB,GAAG,EAAE,EAAE,CAAO,KAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;YACjF,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,4BAA4B,EAAE,UAAC,EAAE;QACvC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,EAAE,MAAM;gBAClC,MAAM,CAAC,IAAI,CAAC,yBAAyB,GAAG,EAAE,EAAE,CAAO,KAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;YAClF,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,4BAA4B,EAAE,UAAC,EAAE;QACvC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE;gBACpB,MAAM,CAAC,IAAI,CAAC,yBAAyB,GAAG,EAAE,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,6BAA6B,EAAE,UAAC,EAAE;QACxC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,EAAE,CAAC,eAAe,EAAE;gBACrB,MAAM,CAAC,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,8BAA8B,EAAE,UAAC,EAAE;QACzC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,EAAE,CAAC,gBAAgB,EAAE;gBACtB,MAAM,CAAC,IAAI,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;YAClD,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,EAAE,SAAS;QACtC,IAAM,IAAI,GAAG,eAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAE/C,yBAAyB,CAAC,IAAI,CAAC,KAAK,EAAE,UAAC,EAAE;YACrC,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,IAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAExE,IAAI,GAAG,IAAI,eAAI,CAAC,SAAS,CAAC,CAAC;QAC3B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE;QACtB,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,OAAO,EAAE,CAAC;SAClB;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,UAAC,KAAK;QAC7B,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,sBAAsB,EAAE,UAAC,KAAK;QACpC,IAAI,IAAI,EAAE;YACN,IAAI,GAAG,GAAG,sBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAC5C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;SAC7B;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,iBAAiB,EAAE,UAAC,OAAO;QACjC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SAC5B;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,UAAC,KAAK;QAC7B,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE,UAAC,IAAI;QACpC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;SAC/B;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,UAAC,OAAO;QACrC,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;SAChC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAAE;QAC1B,IAAI,IAAI,EAAE;YACN,IAAI,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YACrC,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE,WAAW,CAAC,CAAC;SACzD;IACL,CAAC,CAAC,CAAC;IAEH,SAAS,yBAAyB,CAAC,SAAS,EAAE,QAAQ;QAClD,SAAS,CAAC,OAAO,CAAC,UAAC,IAAI;YACnB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC/C,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;aAC3D;YAED,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE;gBACzB,IAAI,CAAC,KAAK,GAAG,cAAQ,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C;QACL,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAA"}
|
||||
@@ -1,128 +0,0 @@
|
||||
import { Menu, Tray, nativeImage } from "electron";
|
||||
const path = require('path');
|
||||
let tray: Electron.Tray;
|
||||
|
||||
export = (socket: SocketIO.Socket) => {
|
||||
socket.on('register-tray-click', (id) => {
|
||||
if (tray) {
|
||||
tray.on('click', (event, bounds) => {
|
||||
socket.emit('tray-click-event' + id, [(<any>event).__proto__, bounds]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('register-tray-right-click', (id) => {
|
||||
if (tray) {
|
||||
tray.on('right-click', (event, bounds) => {
|
||||
socket.emit('tray-right-click-event' + id, [(<any>event).__proto__, bounds]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('register-tray-double-click', (id) => {
|
||||
if (tray) {
|
||||
tray.on('double-click', (event, bounds) => {
|
||||
socket.emit('tray-double-click-event' + id, [(<any>event).__proto__, bounds]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('register-tray-balloon-show', (id) => {
|
||||
if (tray) {
|
||||
tray.on('balloon-show', () => {
|
||||
socket.emit('tray-balloon-show-event' + id);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('register-tray-balloon-click', (id) => {
|
||||
if (tray) {
|
||||
tray.on('balloon-click', () => {
|
||||
socket.emit('tray-balloon-click-event' + id);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('register-tray-balloon-closed', (id) => {
|
||||
if (tray) {
|
||||
tray.on('balloon-closed', () => {
|
||||
socket.emit('tray-balloon-closed-event' + id);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('create-tray', (image, menuItems) => {
|
||||
const menu = Menu.buildFromTemplate(menuItems);
|
||||
|
||||
addMenuItemClickConnector(menu.items, (id) => {
|
||||
socket.emit("trayMenuItemClicked", id);
|
||||
});
|
||||
|
||||
const imagePath = path.join(__dirname.replace('api', ''), 'bin', image);
|
||||
|
||||
tray = new Tray(imagePath);
|
||||
tray.setContextMenu(menu);
|
||||
});
|
||||
|
||||
socket.on('tray-destroy', () => {
|
||||
if (tray) {
|
||||
tray.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('tray-setImage', (image) => {
|
||||
if (tray) {
|
||||
tray.setImage(image);
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('tray-setPressedImage', (image) => {
|
||||
if (tray) {
|
||||
let img = nativeImage.createFromPath(image);
|
||||
tray.setPressedImage(img);
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('tray-setToolTip', (toolTip) => {
|
||||
if (tray) {
|
||||
tray.setToolTip(toolTip);
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('tray-setTitle', (title) => {
|
||||
if (tray) {
|
||||
tray.setTitle(title);
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('tray-setHighlightMode', (mode) => {
|
||||
if (tray) {
|
||||
tray.setHighlightMode(mode);
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('tray-displayBalloon', (options) => {
|
||||
if (tray) {
|
||||
tray.displayBalloon(options);
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('tray-isDestroyed', () => {
|
||||
if (tray) {
|
||||
let isDestroyed = tray.isDestroyed();
|
||||
socket.emit('tray-isDestroyedCompleted', isDestroyed);
|
||||
}
|
||||
});
|
||||
|
||||
function addMenuItemClickConnector(menuItems, callback) {
|
||||
menuItems.forEach((item) => {
|
||||
if (item.submenu && item.submenu.items.length > 0) {
|
||||
addMenuItemClickConnector(item.submenu.items, callback);
|
||||
}
|
||||
|
||||
if ("id" in item && item.id) {
|
||||
item.click = () => { callback(item.id); };
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
var fs = require('fs');
|
||||
module.exports = function (socket) {
|
||||
socket.on('register-webContents-crashed', function (id) {
|
||||
var browserWindow = getWindowById(id);
|
||||
browserWindow.webContents.removeAllListeners('crashed');
|
||||
browserWindow.webContents.on('crashed', function (event, killed) {
|
||||
socket.emit('webContents-crashed' + id, killed);
|
||||
});
|
||||
});
|
||||
socket.on('register-webContents-didFinishLoad', function (id) {
|
||||
var browserWindow = getWindowById(id);
|
||||
browserWindow.webContents.removeAllListeners('did-finish-load');
|
||||
browserWindow.webContents.on('did-finish-load', function () {
|
||||
socket.emit('webContents-didFinishLoad' + id);
|
||||
});
|
||||
});
|
||||
socket.on('webContentsOpenDevTools', function (id, options) {
|
||||
if (options) {
|
||||
getWindowById(id).webContents.openDevTools(options);
|
||||
}
|
||||
else {
|
||||
getWindowById(id).webContents.openDevTools();
|
||||
}
|
||||
});
|
||||
socket.on('webContents-printToPDF', function (id, options, path) {
|
||||
getWindowById(id).webContents.printToPDF(options || {}, function (error, data) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
fs.writeFile(path, data, function (error) {
|
||||
if (error) {
|
||||
socket.emit('webContents-printToPDF-completed', false);
|
||||
}
|
||||
else {
|
||||
socket.emit('webContents-printToPDF-completed', true);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
socket.on('webContents-getUrl', function (id) {
|
||||
var browserWindow = getWindowById(id);
|
||||
socket.emit('webContents-getUrl' + id, browserWindow.webContents.getURL());
|
||||
});
|
||||
function getWindowById(id) {
|
||||
return electron_1.BrowserWindow.fromId(id);
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=webContents.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"webContents.js","sourceRoot":"","sources":["webContents.ts"],"names":[],"mappings":";AAAA,qCAAyC;AACzC,IAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB,iBAAS,UAAC,MAAuB;IAC7B,MAAM,CAAC,EAAE,CAAC,8BAA8B,EAAE,UAAC,EAAE;QACzC,IAAI,aAAa,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QAEtC,aAAa,CAAC,WAAW,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACxD,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,KAAK,EAAE,MAAM;YAClD,MAAM,CAAC,IAAI,CAAC,qBAAqB,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,oCAAoC,EAAE,UAAC,EAAE;QAC/C,IAAI,aAAa,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QAEtC,aAAa,CAAC,WAAW,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;QAChE,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC,iBAAiB,EAAE;YAC5C,MAAM,CAAC,IAAI,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,UAAC,EAAE,EAAE,OAAO;QAC7C,IAAI,OAAO,EAAE;YACT,aAAa,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SACvD;aAAM;YACH,aAAa,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;SAChD;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,wBAAwB,EAAE,UAAC,EAAE,EAAE,OAAO,EAAE,IAAI;QAClD,aAAa,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,EAAE,UAAC,KAAK,EAAE,IAAI;YAChE,IAAI,KAAK,EAAE;gBACP,MAAM,KAAK,CAAC;aACf;YAED,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,UAAC,KAAK;gBAC7B,IAAI,KAAK,EAAE;oBACT,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;iBACxD;qBAAM;oBACL,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,IAAI,CAAC,CAAC;iBACvD;YACH,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAU,EAAE;QACxC,IAAI,aAAa,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,oBAAoB,GAAG,EAAE,EAAE,aAAa,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IAEH,SAAS,aAAa,CAAC,EAAU;QAC7B,OAAO,wBAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;AACL,CAAC,CAAC"}
|
||||
@@ -1,55 +0,0 @@
|
||||
import { BrowserWindow } from 'electron';
|
||||
const fs = require('fs');
|
||||
|
||||
export = (socket: SocketIO.Socket) => {
|
||||
socket.on('register-webContents-crashed', (id) => {
|
||||
var browserWindow = getWindowById(id);
|
||||
|
||||
browserWindow.webContents.removeAllListeners('crashed');
|
||||
browserWindow.webContents.on('crashed', (event, killed) => {
|
||||
socket.emit('webContents-crashed' + id, killed);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('register-webContents-didFinishLoad', (id) => {
|
||||
let browserWindow = getWindowById(id);
|
||||
|
||||
browserWindow.webContents.removeAllListeners('did-finish-load');
|
||||
browserWindow.webContents.on('did-finish-load', () => {
|
||||
socket.emit('webContents-didFinishLoad' + id);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('webContentsOpenDevTools', (id, options) => {
|
||||
if (options) {
|
||||
getWindowById(id).webContents.openDevTools(options);
|
||||
} else {
|
||||
getWindowById(id).webContents.openDevTools();
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('webContents-printToPDF', (id, options, path) => {
|
||||
getWindowById(id).webContents.printToPDF(options || {}, (error, data) => {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
fs.writeFile(path, data, (error) => {
|
||||
if (error) {
|
||||
socket.emit('webContents-printToPDF-completed', false);
|
||||
} else {
|
||||
socket.emit('webContents-printToPDF-completed', true);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('webContents-getUrl', function (id) {
|
||||
var browserWindow = getWindowById(id);
|
||||
socket.emit('webContents-getUrl' + id, browserWindow.webContents.getURL());
|
||||
});
|
||||
|
||||
function getWindowById(id: number): Electron.BrowserWindow {
|
||||
return BrowserWindow.fromId(id);
|
||||
}
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"executable": "{{executable}}"
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
const { app } = require('electron');
|
||||
const { BrowserWindow, dialog, shell } = require('electron');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const process = require('child_process').spawn;
|
||||
const portfinder = require('detect-port');
|
||||
let io, browserWindows, ipc, apiProcess, loadURL;
|
||||
let appApi, menu, dialogApi, notification, tray, webContents;
|
||||
let globalShortcut, shellApi, screen, clipboard;
|
||||
let splashScreen, mainWindowId;
|
||||
|
||||
const manifestJsonFilePath = path.join(__dirname, 'bin', 'electron.manifest.json');
|
||||
const manifestJsonFile = require(manifestJsonFilePath);
|
||||
if (manifestJsonFile.singleInstance) {
|
||||
const shouldQuit = app.requestSingleInstanceLock();
|
||||
app.on('second-instance', (commandLine, workingDirectory) => {
|
||||
mainWindowId && BrowserWindow.fromId(mainWindowId) && BrowserWindow.fromId(mainWindowId).show();
|
||||
});
|
||||
|
||||
if (shouldQuit) {
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
|
||||
app.on('ready', () => {
|
||||
if (isSplashScreenEnabled()) {
|
||||
startSplashScreen();
|
||||
}
|
||||
|
||||
portfinder(8000, (error, port) => {
|
||||
startSocketApiBridge(port);
|
||||
});
|
||||
});
|
||||
|
||||
function isSplashScreenEnabled() {
|
||||
return Boolean(manifestJsonFile.loadingUrl);
|
||||
}
|
||||
|
||||
function startSplashScreen() {
|
||||
let loadingUrl = manifestJsonFile.loadingUrl;
|
||||
let icon = manifestJsonFile.icon;
|
||||
|
||||
if (loadingUrl) {
|
||||
splashScreen = new BrowserWindow({
|
||||
width: manifestJsonFile.width,
|
||||
height: manifestJsonFile.height,
|
||||
transparent: true,
|
||||
frame: false,
|
||||
show: false,
|
||||
icon: path.join(__dirname, icon)
|
||||
});
|
||||
|
||||
if (manifestJsonFile.devTools) {
|
||||
splashScreen.webContents.openDevTools();
|
||||
}
|
||||
|
||||
splashScreen.loadURL(loadingUrl);
|
||||
splashScreen.once('ready-to-show', () => {
|
||||
splashScreen.show();
|
||||
});
|
||||
|
||||
splashScreen.on('closed', () => {
|
||||
splashScreen = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function startSocketApiBridge(port) {
|
||||
io = require('socket.io')(port);
|
||||
startAspCoreBackend(port);
|
||||
|
||||
io.on('connection', (socket) => {
|
||||
global['electronsocket'] = socket;
|
||||
global['electronsocket'].setMaxListeners(0);
|
||||
console.log('ASP.NET Core Application connected...', 'global.electronsocket', global['electronsocket'].id, new Date());
|
||||
|
||||
appApi = require('./api/app')(socket, app);
|
||||
browserWindows = require('./api/browserWindows')(socket, app);
|
||||
ipc = require('./api/ipc')(socket);
|
||||
menu = require('./api/menu')(socket);
|
||||
dialogApi = require('./api/dialog')(socket);
|
||||
notification = require('./api/notification')(socket);
|
||||
tray = require('./api/tray')(socket);
|
||||
webContents = require('./api/webContents')(socket);
|
||||
globalShortcut = require('./api/globalShortcut')(socket);
|
||||
shellApi = require('./api/shell')(socket);
|
||||
screen = require('./api/screen')(socket);
|
||||
clipboard = require('./api/clipboard')(socket);
|
||||
|
||||
if (splashScreen && !splashScreen.isDestroyed()) {
|
||||
splashScreen.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function startAspCoreBackend(electronPort) {
|
||||
portfinder(8000, (error, electronWebPort) => {
|
||||
loadURL = `http://localhost:${electronWebPort}`
|
||||
const parameters = [`/electronPort=${electronPort}`, `/electronWebPort=${electronWebPort}`];
|
||||
let binaryFile = manifestJsonFile.executable;
|
||||
|
||||
const os = require('os');
|
||||
if (os.platform() === 'win32') {
|
||||
binaryFile = binaryFile + '.exe';
|
||||
}
|
||||
|
||||
const binFilePath = path.join(__dirname, 'bin', binaryFile);
|
||||
var options = { cwd: path.join(__dirname, 'bin') };
|
||||
apiProcess = process(binFilePath, parameters, options);
|
||||
|
||||
apiProcess.stdout.on('data', (data) => {
|
||||
console.log(`stdout: ${data.toString()}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
1672
ElectronNET.Host/package-lock.json
generated
1672
ElectronNET.Host/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "electron.net.host",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "main.js",
|
||||
"author": "Gregor Biswanger",
|
||||
"license": "ISC",
|
||||
"scripts": {
|
||||
"start": "tsc -p ."
|
||||
},
|
||||
"dependencies": {
|
||||
"detect-port": "^1.2.3",
|
||||
"electron": "^3.0.0",
|
||||
"socket.io": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/socket.io": "^1.4.38",
|
||||
"@types/node": "^10.11.0",
|
||||
"tslint": "^5.11.0",
|
||||
"typescript": "^3.0.3"
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"sourceMap": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
{
|
||||
"rulesDirectory": [],
|
||||
"rules": {
|
||||
"arrow-return-shorthand": true,
|
||||
"callable-types": true,
|
||||
"class-name": true,
|
||||
"comment-format": [
|
||||
true,
|
||||
"check-space"
|
||||
],
|
||||
"curly": true,
|
||||
"deprecation": {
|
||||
"severity": "warn"
|
||||
},
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"import-blacklist": [
|
||||
true,
|
||||
"rxjs/Rx"
|
||||
],
|
||||
"import-spacing": true,
|
||||
"indent": [
|
||||
true,
|
||||
"spaces"
|
||||
],
|
||||
"interface-over-type-literal": true,
|
||||
"label-position": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
140
|
||||
],
|
||||
"member-access": false,
|
||||
"member-ordering": [
|
||||
true,
|
||||
{
|
||||
"order": [
|
||||
"static-field",
|
||||
"instance-field",
|
||||
"static-method",
|
||||
"instance-method"
|
||||
]
|
||||
}
|
||||
],
|
||||
"no-arg": true,
|
||||
"no-bitwise": true,
|
||||
"no-console": [
|
||||
true,
|
||||
"debug",
|
||||
"info",
|
||||
"time",
|
||||
"timeEnd",
|
||||
"trace"
|
||||
],
|
||||
"no-construct": true,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-super": true,
|
||||
"no-empty": false,
|
||||
"no-empty-interface": true,
|
||||
"no-eval": true,
|
||||
"no-inferrable-types": [
|
||||
true,
|
||||
"ignore-params"
|
||||
],
|
||||
"no-misused-new": true,
|
||||
"no-non-null-assertion": true,
|
||||
"no-redundant-jsdoc": true,
|
||||
"no-shadowed-variable": true,
|
||||
"no-string-literal": false,
|
||||
"no-string-throw": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unnecessary-initializer": true,
|
||||
"no-unused-expression": true,
|
||||
"no-use-before-declare": true,
|
||||
"no-var-keyword": true,
|
||||
"object-literal-sort-keys": false,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-open-brace",
|
||||
"check-catch",
|
||||
"check-else",
|
||||
"check-whitespace"
|
||||
],
|
||||
"prefer-const": true,
|
||||
"quotemark": [
|
||||
true,
|
||||
"single"
|
||||
],
|
||||
"radix": true,
|
||||
"semicolon": [
|
||||
true,
|
||||
"always"
|
||||
],
|
||||
"triple-equals": [
|
||||
true,
|
||||
"allow-null-check"
|
||||
],
|
||||
"typedef-whitespace": [
|
||||
true,
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"unified-signatures": true,
|
||||
"variable-name": false,
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
],
|
||||
"no-output-on-prefix": true,
|
||||
"use-input-property-decorator": true,
|
||||
"use-output-property-decorator": true,
|
||||
"use-host-property-decorator": true,
|
||||
"no-input-rename": true,
|
||||
"no-output-rename": true,
|
||||
"use-life-cycle-interface": true,
|
||||
"use-pipe-transform-interface": true,
|
||||
"component-class-suffix": true,
|
||||
"directive-class-suffix": true
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ElectronNET.WebApp.Controllers
|
||||
{
|
||||
public class AboutController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Controllers\ManageWindowsController.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Remove="Views\Windows\HandleErrorCrashes.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Assets\" />
|
||||
<Folder Include="wwwroot\assets\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ElectronNET.API\ElectronNET.API.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="Assets\electron.ico">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Assets\electron_32x32.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="electron.manifest.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,22 +0,0 @@
|
||||
using ElectronNET.API;
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace ElectronNET.WebApp
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
BuildWebHost(args).Run();
|
||||
}
|
||||
|
||||
public static IWebHost BuildWebHost(string[] args)
|
||||
{
|
||||
return WebHost.CreateDefaultBuilder(args)
|
||||
.UseElectron(args)
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:50394/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"ElectronNET.WebApp": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:50395/"
|
||||
},
|
||||
"Electron.NET App": {
|
||||
"commandName": "Executable",
|
||||
"executablePath": "C:\\Program Files\\dotnet\\dotnet.exe",
|
||||
"commandLineArgs": "electronize start"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
using ElectronNET.API;
|
||||
using ElectronNET.API.Entities;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ElectronNET.WebApp
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddMvc();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||
{
|
||||
loggerFactory.AddConsole();
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseMvc(routes =>
|
||||
{
|
||||
routes.MapRoute(
|
||||
name: "default",
|
||||
template: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
|
||||
|
||||
|
||||
if(HybridSupport.IsElectronActive)
|
||||
{
|
||||
ElectronBootstrap();
|
||||
}
|
||||
}
|
||||
|
||||
public async void ElectronBootstrap()
|
||||
{
|
||||
var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
|
||||
{
|
||||
Width = 1152,
|
||||
Height = 864,
|
||||
Show = false
|
||||
});
|
||||
|
||||
browserWindow.OnReadyToShow += () => browserWindow.Show();
|
||||
browserWindow.SetTitle(Configuration["DemoTitleInSettings"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
<template class="task-template">
|
||||
<section id="clipboard-section" class="section js-section u-category-system">
|
||||
<header class="section-header">
|
||||
<div class="section-wrapper">
|
||||
<h1>
|
||||
<svg class="section-icon"><use xlink:href="assets/img/icons.svg#icon-system"></use></svg>
|
||||
Clipboard
|
||||
</h1>
|
||||
<h3>The <code>Electron.Clipboard</code> provides methods to perform copy and paste operations.</h3>
|
||||
<p>This module also has methods for copying text as markup (HTML) to the clipboard.</p>
|
||||
|
||||
<p>You find the sample source code in <code>Controllers\ClipboardController.cs</code>.</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="demo">
|
||||
<div class="demo-wrapper">
|
||||
<button id="copy-to-demo-toggle" class="js-container-target demo-toggle-button">
|
||||
Copy
|
||||
<div class="demo-meta u-avoid-clicks">Supports: Win, macOS, Linux <span class="demo-meta-divider">|</span> Process: Both</div>
|
||||
</button>
|
||||
<div class="demo-box">
|
||||
<div class="demo-controls">
|
||||
<button class="demo-button" id="copy-to">Copy</button>
|
||||
<input class="demo-input" id="copy-to-input" aria-label="Click copy" placeholder="Click copy."></input>
|
||||
</div>
|
||||
<p>In this example we copy a phrase to the clipboard. After clicking 'Copy' use the text area to paste (CMD + V or CTRL + V) the phrase from the clipboard.</p>
|
||||
<h5>Main Process (C#)</h5>
|
||||
<pre><code class="csharp">Electron.IpcMain.On("copy-to", (text) =>
|
||||
{
|
||||
Electron.Clipboard.WriteText(text.ToString());
|
||||
});</code></pre>
|
||||
<div class="demo-protip">
|
||||
<h2>ProTip</h2>
|
||||
<strong>Electron.js Support in Electron.NET.</strong>
|
||||
<p>The <code>clipboard</code> module is built into Electron.js (therefore you can use this in the renderer processes).</p>
|
||||
<pre><code class="language-js">const clipboard = require('electron').clipboard;
|
||||
|
||||
const copyBtn = document.getElementById('copy-to');
|
||||
const copyInput = document.getElementById('copy-to-input');
|
||||
|
||||
copyBtn.addEventListener('click', () => {
|
||||
if (copyInput.value !== '') copyInput.value = '';
|
||||
copyInput.placeholder = 'Copied! Paste here to see.';
|
||||
clipboard.writeText('Electron Demo!');
|
||||
})</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="demo">
|
||||
<div class="demo-wrapper">
|
||||
<button id="paste-to-demo-toggle" class="js-container-target demo-toggle-button">
|
||||
Paste
|
||||
<div class="demo-meta u-avoid-clicks">Supports: Win, macOS, Linux <span class="demo-meta-divider">|</span> Process: Both</div>
|
||||
</button>
|
||||
<div class="demo-box">
|
||||
<div class="demo-controls">
|
||||
<button class="demo-button" id="paste-to">Paste</button>
|
||||
<span class="demo-response" id="paste-from"></span>
|
||||
</div>
|
||||
<p>In this example we copy a string to the clipboard and then paste the results into a message above.</p>
|
||||
|
||||
<h5>Main Process (C#)</h5>
|
||||
<pre><code class="csharp">Electron.IpcMain.On("paste-to", async (text) =>
|
||||
{
|
||||
Electron.Clipboard.WriteText(text.ToString());
|
||||
string pasteText = await Electron.Clipboard.ReadTextAsync();
|
||||
|
||||
var mainWindow = Electron.WindowManager.BrowserWindows.First();
|
||||
Electron.IpcMain.Send(mainWindow, "paste-from", pasteText);
|
||||
});</code></pre>
|
||||
|
||||
<div class="demo-protip">
|
||||
<h2>ProTip</h2>
|
||||
<strong>Electron.js Support in Electron.NET.</strong>
|
||||
<p>The <code>clipboard</code> module is built into Electron.js (therefore you can use this in the renderer processes).</p>
|
||||
<pre><code class="language-js">const clipboard = require('electron').clipboard;
|
||||
|
||||
const pasteBtn = document.getElementById('paste-to');
|
||||
|
||||
pasteBtn.addEventListener('click', () => {
|
||||
clipboard.writeText('What a demo!');
|
||||
const message = `Clipboard contents: ${clipboard.readText()}`;
|
||||
document.getElementById('paste-from').innerHTML = message;
|
||||
})</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function(){
|
||||
const { ipcRenderer } = require("electron");
|
||||
|
||||
document.getElementById("copy-to").addEventListener("click", () => {
|
||||
document.getElementById('copy-to-input').placeholder = 'Copied! Paste here to see.';
|
||||
ipcRenderer.send("copy-to", "Electron.NET Demo!");
|
||||
});
|
||||
|
||||
document.getElementById("paste-to").addEventListener("click", () => {
|
||||
ipcRenderer.send("paste-to", "What a demo!");
|
||||
});
|
||||
|
||||
ipcRenderer.on("paste-from", (sender, text) => {
|
||||
const message = `Clipboard contents: ${text}`;
|
||||
document.getElementById("paste-from").innerText = message;
|
||||
});
|
||||
|
||||
}());
|
||||
</script>
|
||||
|
||||
</section>
|
||||
</template>
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"executable": "ElectronNET.WebApp"
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
const demoBtns = document.querySelectorAll('.js-container-target');
|
||||
|
||||
// Listen for demo button clicks
|
||||
Array.prototype.forEach.call(demoBtns, function (btn) {
|
||||
btn.addEventListener('click', function (event) {
|
||||
const parent = event.target.parentElement;
|
||||
|
||||
// Toggles the "is-open" class on the demo's parent element.
|
||||
parent.classList.toggle('is-open');
|
||||
})
|
||||
})
|
||||
@@ -1,12 +0,0 @@
|
||||
const links = document.querySelectorAll('link[rel="import"]')
|
||||
|
||||
// Import and add each page to the DOM
|
||||
Array.prototype.forEach.call(links, function (link) {
|
||||
let template = link.import.querySelector('.task-template')
|
||||
let clone = document.importNode(template.content, true)
|
||||
if (link.href.match('about.html')) {
|
||||
document.querySelector('body').appendChild(clone)
|
||||
} else {
|
||||
document.querySelector('.content').appendChild(clone)
|
||||
}
|
||||
})
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27130.2027
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.WebApp", "ElectronNET.WebApp\ElectronNET.WebApp.csproj", "{7C048379-401C-4345-B5E7-BE232DEA8157}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.API", "ElectronNET.API\ElectronNET.API.csproj", "{A78157BA-B754-45F1-969F-D6A513CA0E72}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.CLI", "ElectronNET.CLI\ElectronNET.CLI.csproj", "{CE3EB0F2-DA39-427A-85D2-E00D660EBFDE}"
|
||||
EndProject
|
||||
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "ElectronNET.Host", "ElectronNET.Host\", "{B33E9B82-B6B4-4DB0-B6EE-61CC34641518}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
|
||||
Debug.AspNetCompiler.VirtualPath = "/localhost_56840"
|
||||
Debug.AspNetCompiler.PhysicalPath = "ElectronNET.Host\"
|
||||
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_56840\"
|
||||
Debug.AspNetCompiler.Updateable = "true"
|
||||
Debug.AspNetCompiler.ForceOverwrite = "true"
|
||||
Debug.AspNetCompiler.FixedNames = "false"
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.VirtualPath = "/localhost_56840"
|
||||
Release.AspNetCompiler.PhysicalPath = "ElectronNET.Host\"
|
||||
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_56840\"
|
||||
Release.AspNetCompiler.Updateable = "true"
|
||||
Release.AspNetCompiler.ForceOverwrite = "true"
|
||||
Release.AspNetCompiler.FixedNames = "false"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
VWDPort = "56840"
|
||||
SlnRelativePath = "ElectronNET.Host\"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2914CCF7-27C2-42AE-849A-2F0C1BC7CDFA}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
buildAll.cmd = buildAll.cmd
|
||||
buildAll.sh = buildAll.sh
|
||||
buildReleaseNuGetPackages.cmd = buildReleaseNuGetPackages.cmd
|
||||
Changelog.md = Changelog.md
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7C048379-401C-4345-B5E7-BE232DEA8157}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7C048379-401C-4345-B5E7-BE232DEA8157}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7C048379-401C-4345-B5E7-BE232DEA8157}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7C048379-401C-4345-B5E7-BE232DEA8157}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A78157BA-B754-45F1-969F-D6A513CA0E72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A78157BA-B754-45F1-969F-D6A513CA0E72}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A78157BA-B754-45F1-969F-D6A513CA0E72}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A78157BA-B754-45F1-969F-D6A513CA0E72}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CE3EB0F2-DA39-427A-85D2-E00D660EBFDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CE3EB0F2-DA39-427A-85D2-E00D660EBFDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CE3EB0F2-DA39-427A-85D2-E00D660EBFDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CE3EB0F2-DA39-427A-85D2-E00D660EBFDE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B33E9B82-B6B4-4DB0-B6EE-61CC34641518}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B33E9B82-B6B4-4DB0-B6EE-61CC34641518}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B33E9B82-B6B4-4DB0-B6EE-61CC34641518}.Release|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B33E9B82-B6B4-4DB0-B6EE-61CC34641518}.Release|Any CPU.Build.0 = Debug|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {81A62E71-9E04-4EFE-AD5C-23165375F8EF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user