mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-10-01 11:22:53 +00:00
prototype of electron host hook service and api implementation
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
"use strict";
|
||||
var electron_1 = require("electron");
|
||||
module.exports = function (socket) {
|
||||
socket.on('shell-showItemInFolder', function (fullPath) {
|
||||
var success = electron_1.shell.showItemInFolder(fullPath);
|
||||
const electron_1 = require("electron");
|
||||
module.exports = (socket) => {
|
||||
socket.on('shell-showItemInFolder', (fullPath) => {
|
||||
const 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.on('shell-openItem', (fullPath) => {
|
||||
const success = electron_1.shell.openItem(fullPath);
|
||||
socket.emit('shell-openItemCompleted', success);
|
||||
});
|
||||
socket.on('shell-openExternal', function (url, options, callback) {
|
||||
var success = false;
|
||||
socket.on('shell-openExternal', (url, options, callback) => {
|
||||
let success = false;
|
||||
if (options && callback) {
|
||||
success = electron_1.shell.openExternal(url, options, function (error) {
|
||||
success = electron_1.shell.openExternal(url, options, (error) => {
|
||||
socket.emit('shell-openExternalCallback', [url, error]);
|
||||
});
|
||||
}
|
||||
@@ -24,19 +24,19 @@ module.exports = function (socket) {
|
||||
}
|
||||
socket.emit('shell-openExternalCompleted', success);
|
||||
});
|
||||
socket.on('shell-moveItemToTrash', function (fullPath) {
|
||||
var success = electron_1.shell.moveItemToTrash(fullPath);
|
||||
socket.on('shell-moveItemToTrash', (fullPath) => {
|
||||
const success = electron_1.shell.moveItemToTrash(fullPath);
|
||||
socket.emit('shell-moveItemToTrashCompleted', success);
|
||||
});
|
||||
socket.on('shell-beep', function () {
|
||||
socket.on('shell-beep', () => {
|
||||
electron_1.shell.beep();
|
||||
});
|
||||
socket.on('shell-writeShortcutLink', function (shortcutPath, operation, options) {
|
||||
var success = electron_1.shell.writeShortcutLink(shortcutPath, operation, options);
|
||||
socket.on('shell-writeShortcutLink', (shortcutPath, operation, options) => {
|
||||
const 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.on('shell-readShortcutLink', (shortcutPath) => {
|
||||
const shortcutDetails = electron_1.shell.readShortcutLink(shortcutPath);
|
||||
socket.emit('shell-readShortcutLinkCompleted', shortcutDetails);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user